Sitemap Sitemap  |  Contact Us Contact Us  |  Clients Clients
   UnpackDateTime
  Home |  WebHare Lite |  Downloads |  HareScript |  Websites/CMS |  Applications
Search for:  in: 
HareScript
General functions
 
Base functions
Cryptography APIs
Date and time manipulation
Developers support
Mathematic and floating point utility functions
Money type utility functions
UnpackDateTime
  Returns a record from an unpacked timestamp
 
Library wh::datetime.whlib
 
Syntax PUBLIC RECORD FUNCTION UnpackDateTime (DATETIME date)
 
Description UnpackDateTime takes a DateTime value and returns a record containing the unpacked parts of the DateTime value
 
Parameters
date The DateTime value to unpack
 
Returns A record with the unpacked date and time. If an invalid date was used, the function returns a non-existing record.
  The record contains the following cells:
year An integer representing the year part of timestamp date.
month An integer representing the month part of timestamp date. 1 = Januari, 2 = Februari etc.
week An integer representing the week part of timestamp date. 1 = the first week, 2 = the second week etc.
According to ISO-8601, week 1 of a given year is the week that includes the first thursday of that year.
dayofyear An integer representing the day of the year at timestamp date. 1 = Januari 1st, 2 = Januari 2nd, 32 = Februari 1st etc.
dayofmonth An integer representing the day of the month at timestamp date. 1 = the first day, 2 = the second day etc.
dayofweek An integer representing the day of the week at timestamp date. 1 = monday, 2 = tuesday etc.
hour An integer representing the hour of the day at timestamp date. Ranges from 0 to 23
minute An integer representing the minute of the hour at timestamp date. Ranges from 0 to 59
second An integer representing the second of the minute at timestamp date. Ranges from 0 to 59
msecond An integer representing the millisecond of the second at timestamp date. Ranges from 0 to 999
 
Example
// Unpack the current DateTime
RECORD currentDateTime := UnpackDateTime(GetCurrentDateTime());

// Get the current hour
INTEGER theHour := currentDateTime.hour

// Get the current day of the week
INTEGER theWeekDay := currentDateTime.dayofweek
 
In library 'datetime'
AddDaysToDate
AddMonthsToDate
AddTimeToDate
FormatDateTime
GetCurrentDateTime
GetDatetimeDifference
GetDayCount
GetLanguageDatetimeStrings
GetMonthLength
GetMsecondCount
GetMsecsDifference
GetYearLength
LocalToUTC
MakeDate
MakeDateFromDayCount
MakeDateFromParts
MakeDateFromText
MakeDateTime
MakeDayCount
MakeTime
UnpackDateTime
UTCtoLocal
 
Top To top of page