-
-
Save ztirom/5a707afcaed38984b3a4e69dddce08b9 to your computer and use it in GitHub Desktop.
DateTimeToDate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void DateTimeToDate(Args _args) | |
{ | |
utcDateTime toDateTime; | |
// Get today's date and a null date | |
date fromDate = today(), toDate = dateNull(); | |
// Info the date | |
info(date2str(fromDate, | |
321, /* style - ymd */ | |
2, /* digits day - DateDay::Digits2 */ | |
DateSeparator::Dot, /* separator */ | |
2, /* digits month - DateMonth::Digits2 */ | |
DateSeparator::Dot, /* separator */ | |
4 /* digits year - DateYear::Digits4 */)); | |
// Convert to utcDateTime | |
toDateTime = DateTimeUtil::newDateTime(fromDate, 0 /* time */); | |
// Info it out | |
info(DateTimeUtil::toStr(toDateTime)); | |
// Create a date again | |
toDate = DateTimeUtil::date(toDateTime); | |
// ... and info it again | |
info(date2str(toDate, | |
321, /* style - ymd */ | |
2, /* digits day - DateDay::Digits2 */ | |
DateSeparator::Dot, /* separator */ | |
2, /* digits month - DateMonth::Digits2 */ | |
DateSeparator::Dot, /* separator */ | |
4 /* digits year - DateYear::Digits4 */)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment