The BIN_DATE function converts a standard form ASCII date/time string to a binary string.

This routine is written in the IDL language. Its source code can be found in the file bin_date.pro in the lib subdirectory of the IDL distribution.

Examples


Convert a random time of the day to binary:

time = 'WED APR 03 04:04:04 2013'
binTime = BIN_DATE(time)
PRINT, binTime

IDL displays:

2013             4             3             4             4             4
 

Convert the system time to binary:

result = BIN_DATE(systime(0))
PRINT, result

Syntax


Result = BIN_DATE(Ascii_Time)

Return Value


The function returns a six-element integer array where:

  • Element 0 is the year (e.g., 1994)
  • Element 1 is the month (1-12)
  • Element 2 is the day (1-31)
  • Element 3 is the hour (0-23)
  • Element 4 is minutes (0-59)
  • Element 5 is seconds (0-59)

Arguments


Ascii_Time

A string containing the date/time to convert in standard ASCII format. If this argument is omitted, the current date/time is used. Standard form is a 24 character string:

DOW MON DD HH:MM:SS YYYY

where DOW is the day of the week, MON is the month, DD is the day of month, HH:MM:SS is the time in hours, minutes, second, and YYYY is the year.

Keywords


None.

Version History


Pre 4.0

Introduced

See Also


CALDAT, JULDAY, SYSTIME