Description
When working with date and time in your applications it is important to consider for example:
- The different timezones
- Daylight saving time
- The current system date and time
- But also the milliseconds it takes to startup a system
The DataFlex Date & Time Library contains several functions to assist with anything date and time related in your DataFlex applications.This download contains a library and a demo application. The library can be used when working with dates and times. The library contains three classes
- cDateTimeHandler
- cMathHandler
- cLocaleInfoHandler
Note
The Conversions Library is needed to be able to install and use this library
Features
cDateTimeHandler class
This class contains the following functions:
- CompareFileTimes - Compares two time values (earlier, equal and later)
- TickCount / TickCount64 - Retrieves the number of milliseconds that have elapsed since the system was started
- SetLocalTime - Sets the current local time and date
- SystemTimes - Retrieves system timing information
- QueryPerformanceCounter - Retrieves the current value of the performance counter
- QueryPerformancePercentage - Retrieves the frequency of the performance counter
- QueryUnbiasedInterruptTime - Gets the current unbiased interrupt-time count
- SystemTime - Retrieves the current system date and time in UTC format
- SetSystemTime - Changes the system time
- SystemTimeAdjustment - Determines whether the system is applying periodic time adjustments to its time-of-day clock
- FormatSystemTimeToTime - Formats a tSystemTime value to a DataFlex Time value using the regional settings
- TimeZoneInformation - Retrieves the current time zone settings
- TimeZoneInformationForYear - Retrieves the current time zone settings for a specific year
- SystemTimeToFileTime - Helper function to convert a time value
- SystemTimeToTzSpecificLocalTime - Converts a tSystemTime value via TimeZoneInformation to a TimeZone Specific Local Time
- FileTimeToLocalFileTime - Converts a UTC file time to a local file time
- FormatSystemTimeToDate - Formats a tSystemTime value to a DataFlex Date value using the regional settings
- FileTimeToDateTime - Converts a tWinFileTime value to a DataFlex DateTime value
- SystemTimeAsFileTime - Retrieves the current system Date and Time in UTC format
- DateTimeToFileTime - Converts a DateTime value into a tWinFileTime value
- DateTimeToSystemTime - Converts a DateTime value to a tSystemTime Value
- TransitionDateTime - Converts a transition time (from DST to STD or vice-versa) to a formatted date and time
- FirstDayOfWeek - Ask the Windows API what the first day of the week is for the current locale
- FirstWeekOfYear - Ask the Windows API what the first week of a year is for the current locale
- MondayOfWeekYear - Returns the date of the monday in a given week in a given year
- StartDateFirstWeekOfYear - Returns the date of the first day of the first week in a given year
- TransitionDateTimeForYear - Converts - like the TransitionDateTime - a transition time (from DST to STD or vice-versa) to a formatted date and time
- SystemTimeToDateTime - Formats a tSystemTime value to a DataFlex DateTime value
- ISO8601WeekNumber - Returns the weeknumber of a given date according to ISO 8601
- UnixTimeToUTCDateTime - Calculates the UTC DateTime from a UNIX time
- UnixTimeToLocalDateTime - Calculates the DateTime from a UNIX time
- DateTimeToUnixTime - Returns the UNIX time from a given datetime value
- DateTimeToJavaScriptTime - Returns the JavaScript time from a given datetime value. JS time is the number of milliseconds since 1/1/1970
- JavaScriptTimeToLocalDateTime - Calculates the DateTime from a JavaScript time. JS time is the number of milliseconds since 1/1/1970
- JavaScriptTimeToUTCDateTime - Calculates the UTC DateTime from a JavaScript time. JS time is the number of milliseconds since 1/1/1970
- CurrentUTCDateTime - Gets the UTC date & time by converting the local date & time to a UNIX time which is always a UTC time
Note: The JavaScript* functions do only exist in version 20.1.1 and higher of the library
cMathHandler class
This class contains the following helper functions
- Ceiling - Returns the least integer less than or equal to the passed value
- Floor - Returns the greatest integer less than or equal to the passed value
cLocaleInfoHandler class
This class contains the following helper functions
- LocaleMonthName - Retrieves the locale value for the month name for the locale specified in psLocaleName
- LocaleDayName - Retrieves the locale value for the day name for the locale specified in psLocaleName
- LocaleShortDateFormat - Retrieves the short date format for the locale specified in psLocaleName
- LocaleLongDateFormat - Retrieves the long date format for the locale specified in psLocaleName
- LocaleTimeFormat - Retrieves the time format for the locale specified in psLocaleName
- LocaleFirstDayOfWeek - Retrieves the locale value for the first day of the week for the locale specified in psLocaleName
- LocaleFirstWeekOfYear - Ask the Windows API what the first week of a year is for the locale specified in psLocaleName
- LocaleDecimalSeparator - Retrieves the decimal separator for the locale specified in psLocaleName
- LocaleThousandsSeparator - Retrieves the thousands separator for the locale specified in psLocaleName
- LocaleCurrencySymbol - Retrieves the currency symbol for the locale specified in psLocaleName
- AllLocaleCodes - Return all possible locale codes
Screenshots













