Navigation: DocScript Reference > DocScript Functions >

Date/Time Functions

 

 

 

 

Function

Description

[DateTime.Year]()

Returns the current year.

[DateTime.Month]()

Returns the current month. 1 - 12.

[DateTime.DOM]()

Returns the current day of the month. 1 - 31.

[DateTime.DOY]()

Returns the current day of the year. 1 - 365.

[DateTime.DOW]()

Returns the current day of the week. (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday).

[DateTime.Hour]()

Returns the current hour. 0 - 23.

[DateTime.Minute]()

Returns the current minute. 0 - 59.

[DateTime.Second]()

Returns the current second. 0 - 59.

[DateTime.Millisecond]()

Returns the current millisecond. 0 - 999.

[DateTime.Ticks]()

Returns the current tick on the PC.

[DateTime.Now]()

Returns the current date and time as a string. (Month/Day/Year Hour:Minute:Second).

[DateTime.Today]()

Returns the current date as a string: Month/Day/Year.

[DateTime.TimeOfDay]()

Returns the current time as a string: Hour:Minute:Second.

[DateTime.UTCNow]()

Returns the current UTC date and time as a string: Month/Day/Year Hour:Minute:Second.

[DateTime.ReformatDateTime](datetimestring, newformat)

Will convert the datetimestring to the new format.
Note, you can use any custom .NET style date and time format string. See http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx for more information.

 

Parameter(s)

datetimestring - The date/time string.

newformat - The target date/time format.

[DateTime.ReformatDateTime](datetimestring, oldformat, newformat)

Will convert the datetimestring which uses the old format to the new format. Note, you can use any custom .NET style date and time format string. See http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx for more information.

 

Parameter(s)

datetimestring - The date/time string.

oldformat - The existing date/time format.

newformat - The target date/time format.

[DateTime.Compare](date1, date2)

Returns 0 if dates are the same; -1 if date1 is earlier; +1 if date1 is later.

 

Parameter(s)

date1 - The first date to compare.

date2 - The second date to compare.

[DateTime.Same](date1,date2)

Returns 0 if the dates are the same; -1 if date1 is earlier; +1 if date1 is later.

 

Parameter(s)

date1 - The first date to check.

date2 - The second date to check.

[DateTime.Earlier](date1, date2)

Returns 0 if date1 is later; 0 if both the same; 1 if date1 is earlier.

 

Parameter(s)

date1 - The first date to check.

date2 - The second date to check.

[DateTime.EarlierOrSame](date1, date2)

Returns 0 if date1 is later; 1 if both the same; 1 if date1 is earlier.

 

Parameter(s)

date1 - The first date to check.

date2 - The second date to check.

[DateTime.Later](date1, date2)

Returns 1 if date1 is later; 0 if both the same; 0 if date1 is earlier.

 

Parameter(s)

date1 - The first date to check.

date2 - The second date to check.

[DateTime.LaterOrSame](date1, date2)

Returns 1 if date1 is later; 1 if both the same; 0 if date1 is earlier.

 

Parameter(s)

date1 - The first date to check.

date2 - The second date to check.

 

 

 

 

Copyright © 2024 Portford Solutions Group, Inc.