NetSuite Data Provider - Online Help
NetSuite Data Provider
Questions / Feedback?

DATE Functions

CURRENT_DATE()

Returns the current datetime value.
  • outputformat: The format specifier. Valid specifiers: d(short date pattern), D(long date pattern), f(long date/short time pattern), F(long date/time pattern), g(general short date/time pattern), G(general short date/long time pattern), r or R(RFC1123 pattern), s(sortable date/time pattern), t(short time pattern), T(long time pattern), file(windows file time), MM/dd/yy, etc.

CURRENT_TIMESTAMP()

Returns the current time stamp of the database system as a datetime value. This value is equal to GETDATE and SYSDATETIME.

DATEADD (datepart , number , date [, dateformat])

Returns the datetime value that results from adding the specified number (a signed integer) to the specified date part of the date.
  • datepart: The part of the date to add the specified number to. The valid values and abbreviations are year (yy, yyyy), quarter (qq, q), month (mm, m), dayofyear (dy, y), day (dd, d), week (wk, ww), weekday (dw), hour (hh), minute (mi, n), second (ss, s), and millisecond (ms).
  • number: The number to be added.
  • date: The expression of the datetime data type.
  • dateformat: The optional output date format.

DATEDIFF ( datepart , startdate , enddate )

Returns the difference (a signed integer) of the specified time interval between the specified start date and end date.
  • datepart: The part of the date that is the time interval of the difference between the start date and end date. The valid values and abbreviations are day (dd, d), hour (hh), minute (mi, n), second (ss, s), and millisecond (ms).
  • startdate: The datetime expression of the start date.
  • enddate: The datetime expression of the end date.

DATEFROMPARTS(year, month, day)

Returns the datetime value for the specified year, month, and day.
  • year: The integer expression specifying the year.
  • month: The integer expression specifying the month.
  • day: The integer expression specifying the day.

DATENAME(datepart , date)

Returns the character string that represents the specified date part of the specified date.
  • datepart: The part of the date to return. The valid values and abbreviations are year (yy, yyyy), quarter (qq, q), month (mm, m), dayofyear (dy, y), day (dd, d), week (wk, ww), weekday (dw), hour (hh), minute (mi, n), second (ss, s), millisecond (ms), microsecond (mcs), nanosecond (ns), and TZoffset (tz).
  • date: The datetime expression.

DATEPART(datepart, date [,datefirst])

Returns a character string that represents the specified date part of the specified date.
  • datepart: The part of the date to return. The valid values and abbreviations are year (yy, yyyy), quarter (qq, q), month (mm, m), dayofyear (dy, y), day (dd, d), week (wk, ww), weekday (dw), hour (hh), minute (mi, n), second (ss, s), millisecond (ms), microsecond (mcs), nanosecond (ns), TZoffset (tz), and ISO_WEEK (isowk,isoww).
  • date: The datetime string.
  • datefirst: The optional datetime string.

DATETIME2FROMPARTS(year, month, day, hour, minute, seconds, fractions, precision)

Returns the datetime value for the specified year, month, and day.
  • year: The integer expression specifying the year.
  • month: The integer expression specifying the month.
  • day: The integer expression specifying the day.
  • hour: The integer expression specifying the hour.
  • minute: The integer expression specifying the minute.
  • seconds: The integer expression specifying the seconds.
  • fractions: The integer expression specifying the fractions of the second.
  • precision: The integer expression specifying the precision of the fraction.

DATETIMEFROMPARTS(year, month, day, hour, minute, seconds, milliseconds)

Returns the datetime value for the specified year, month, and day.
  • year: The integer expression specifying the year.
  • month: The integer expression specifying the month.
  • day: The integer expression specifying the day.
  • hour: The integer expression specifying the hour.
  • minute: The integer expression specifying the minute.
  • seconds: The integer expression specifying the seconds.
  • milliseconds: The integer expression specifying the milliseconds.

DAY(date)

Returns the integer that specifies the day component of the specified date.
  • date: The datetime string that specifies the date.

EOMONTH(start_date [, month_to_add ])

Returns the last day of the month that contains the specified date with an optional offset.
  • start_date: The datetime expression specifying the date for which to return the last day of the month.
  • month_to_add: The optional integer expression specifying the number of months to add to start_date.

GETDATE()

Returns the current time stamp of the database system as a datetime value. This value is equal to CURRENT_TIMESTAMP and SYSDATETIME.

GETUTCDATE()

Returns the current time stamp of the database system formatted as a UTC datetime value. This value is equal to SYSUTCDATETIME.

ISDATE(date, [date_format])

Returns 1 if the value is a valid date, time, or datetime value; otherwise, 0.
  • date: The datetime string.
  • date_format: The optional datetime format.

SMALLDATETIMEFROMPARTS(year, month, day, hour, minute)

Returns the datetime value for the specified date and time.
  • year: The integer expression specifying the year.
  • month: The integer expression specifying the month.
  • day: The integer expression specifying the day.
  • hour: The integer expression specifying the hour.
  • minute: The integer expression specifying the minute.

SYSDATETIME()

Returns the current time stamp as a datetime value of the database system. It is equal to GETDATE and CURRENT_TIMESTAMP.

SYSUTCDATETIME()

Returns the current system date and time as a UTC datetime value. It is equal to GETUTCDATE.

TIMEFROMPARTS(hour, minute, seconds, fractions, precision)

Returns the time value for the specified hour, minute, and second.
  • hour: The integer expression specifying the hour.
  • minute: The integer expression specifying the minute.
  • seconds: The integer expression specifying the seconds.
  • fractions: The integer expression specifying the fractions of the second.
  • precision : The integer expression specifying the precision of the fraction.

YEAR(date)

Returns the integer that specifies the year of the specified date.
  • date: The datetime string.

 
 
Copyright (c) 2015 RSSBus, Inc. - All rights reserved.
Build 1.0.5578.0