Date

Date is only available as object

It' save always  Date + Time

Default date is the company Date

 

let a=new Date(); // the current Date + Time

or via global function Date()

let a=Date(); // return current company Date + Time as object

 

Define Date:

Date(year,month,day,hh,mm,ss)  It's working with 1-6 parameters

Date(String) Convert String to DateTime. Best Format is yyyy/mm/dd hh:mm:ss

 

 

Methods

Method

Description

toString(x)

toDateString(x)

Convert Date to String

dbString()

Return Date as String for SQL Statements

getFullYear()

return year as number

getMonth()

return month as number

getDay()

return day as number

getHours()

return hour as number

getMinutes()

return minute as number

getSeconds()

return seconds as number

timeToSec()

getMonthName()

getWeekDayName()

Return Week day Name as String WordId

getWeekDay()

nextWeekDay(x)

Return next Date for this Week day

toJulianDate

Return the Julian Date as Number

 

Date Operations

Method

Description

bod(), eod()

Return Begin of Date and End of Date as DateTime

bom(),eom()

Return Begin of Month with time 0:00, End of Month with time 23:59

boy(),eoy()

Return Begin of Year with time 0:00, End of Year with time 23:59

addSeconds(x)

Increase/Decrease Date with defined Seconds

addMinutes(x)

Increase/Decrease Date with defined Minutes

addHours(x)

Increase/Decrease Date with defined Hours

addDays(x)

addWorkDays(x)

addMonth(x)

addYears(x)

not supported

dayTemplate()

Return the day Template as String based on company calender

dayWorkPercent()

Return Work day in Percent

isWorkDay()

isResourceWorkDay()

Return if this is a work day for a resource. Return boolean

dayInfo()

Return Company Info from current date

dayResourcePercent()

Return Work day Percent from Resource Calender

 

Week functions

Method

Description

bow()

Return first day of week

eof()

Return last day of week

toWeek()

Return current Week as number  

toYeearWeek()

Return current Year / week as number

 

Additional functions, not related to current value

Method

Description

cpu()

return CPU time (milliseconds since start of the computer) as number

secToTimeString(x)

Convert Seconds and return string in format hhhh:mm

secondsBetweenDates(x,y)

Return seconds between Date x and Date y

workdaysBetweenDates(x,y)

Return count of Workdays between Dates

daysBetweenDates(x,y)

Return calendar days between Dates