Extracting Date/Time from DATETIME data type

Posted by Admin on 09-Feb-2009 10:01

What is the best way to extract the date and time from a DATETIME data type? I've tried doing this by assigning them to a string variable and using the ENTRY() function, I've also tried converting the DATETIME variable to STRING but only the date is saved then. Any ideas? Thanks.

Message was edited by:

David Senter

All Replies

Posted by jmls on 10-Feb-2009 04:28

Posted by Admin on 16-Feb-2009 10:13

Try this

define variable vDatum as datetime no-undo.

assign vDatum = now.

message vDatum skip

year(vDatum) skip

month(vDatum) skip

day(vDatum) skip

MTIME(vDatum) skip /* is in milliseconds */

MTIME(vDatum) / 1000 / 3600

/* etc ... */ view-as alert-box info buttons OK.

Regards,

Jan

This thread is closed