XML Script logo
Function date_convert
Name

date_convert

Returns

number

Parameter count

2

Parameter 1

date, a string

Parameter 2

format, a string

Description


This function interprets 'date' according to 'format' and converts it to a UTC timestamp. If the date string did not match the format string, -1 is returned. For the month either abbreviated or full names canbe used. It is possible to use more than one format type in the format parameter. See the topics section for an example of this. If you do not know what format the date is in, for example if you have the Date: header of a mail or news post, try using date_parse instead.
The following are interpreted in 'format string':
%r - 12 hour time (hh:mm:ss [ap]m)
%T - 24 hour time (hh:mm:ss)
%D - US style date (MM/DD/YY)
%B - Month name
%H - Hour(0-23)
%M - Minute (0-59)
%S - Second (0-59)
%d - Day of month (1-31)
%m - Month of year (1-12)
%y - Year without century (YY)
%Y - Year with century (YYYY)
%% - A literal %
All other characters are treated literally and must match the date string exactly.

Examples of use

                                
                        

XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs

X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited
© Copyright 1998-2000 DecisionSoft Limited