Navigation:  thinBasic Modules > DT (Date Handling) >

DT_GetTimeStamp

Previous pageReturn to chapter overviewNext page

 

Description

 

The DT_GetTimeStamp() function returns the time stamp from a given date and time string.

It can returns time stamp in a long or short form.

 

Syntax

 

DT_GetTimeStamp(sDate AS STRING,

sTime AS STRING,

nForm AS NUMBER,

) AS STRING

 

Returns

 

Returns AS STRING

  The time stamp in one of following two forms:

          Short form: "yyyymmddhhmmss" (14 digits)

        Long form  "Mon, dd/mmm/yyyy hh:mm:ss" (25 digits)

 

Parameters

 

sDate AS STRING

  The date string, if empty the function will use the current date

sTime AS STRING

  The date string, if empty the function will use the current time

nForm AS NUMBER

  Specify the time stamp form request, it can be one of following:

%DT_USE_LONG_FORM  

%DT_USE_SHORT_FORM      

 

Remarks

 

The value of sDate parameter should be like “mm-dd-yy” or “mm-dd-yyyy”.

If the the year is two digits only the calculation is done using the century (default %DT_DATE_CENTURY).

Restrictions

 

 

See also

 

 DT_ CookieDate

 

 

Examples

 

MSGBOX 0, DT_GetTimeStamp("06-13-05", "15:16:17", %DT_USE_SHORT_FORM)  ' results 20050613151617

 

© 2004-2008 thinBasic. All rights reserved. Version 1.7.0.0 Web Site: http://www.thinbasic.com