3.5.9 Date and Time

Note: Beginning with Origin 2019, there are three date-time systems in Origin. The default system remains the long-time, adjusted Julian Date system as explained in Dates and Times in Origin. The examples in the table below assume the long-time, default date-time system and when you see "Julian-date value", this refers to Origin's adjusted date value. These functions should work with the alternate systems ...

date2str(today(), "MM/dd/yyyy")$ = 09/27/2018 // default date-time system
date2str(today(), "MM/dd/yyyy")$ = 09/27/2018 // "2018" system, @DSP=2018

... but keep in mind that the numeric values that equate to a given calendar date will differ between systems:

date(9/27/2018) = 2458388 // default date-time system
date(9/27/2018) = 269 // "2018" system, @DSP=2018

For information on Origin's alternate date-time schemes, see Alternate Date-Time Systems in Origin.

Name Brief Description Example
AddDay Returns the added-day(s) time data when hours wrap after 24. Example
Date Returns the Julian-day value which Origin uses internally to represent dates. Example
Date2str Returns the date string corresponding to the input Julian-day value. Example
DatePart Returns as a double, a specific portion of a Julian-day value. Example
Day Returns the day number of a given date. Example
Hour Returns the hour as an integer, ranging from 0 (12:00 A.M.) to 23 (11:00 P.M.). Example
Minute Returns the minutes as an integer, ranging from 0 to 59. Example
Month Return the month as an integer from 1 (January) to 12 (December). Example
MonthName Returns the Month name for specified month by index of 1 to 12, or as a Date value. Example
Now Returns the current date-time as a date(Julian days) value. Example
Quarter Returns current quarter of time. Example
Second Returns the seconds as a real value in the range 0 (zero) to 59.9999... Example
Today Returns the current date as a date(Julian days) value. Example
Time Returns the Julian-day value which Origin uses internally to represent time. Example
Time2str Returns the time string corresponding to the input Julian-day value. Example
UnixTime Convert between Unix timestamp and Julian-day value. Example
WeekDay Returns the day of the week according to calculate a date. By default, the day is ranging from 0 (Sunday) to 6 (Saturday). Example
WeekDayName Returns the name of the weekday according to index of the day of the week or date in Julian format. Example
WeekNum Return a number that indicates the calendar week number of the year. Example
Year Return the year as an integer in the range 0100-9999. Example
YearName Returns the year in string form with input of year or date, with option n. Example