WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Formatting UDFs

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

YMDHMS to normal date conversion

 Keywords:  converting timecodes

;UDF to convert WinBatch YmdHms format time to
;a human readable time.  USA MM/DD/YYYY HH:MM:SS AMPM format

#DefineFunction YmdHms2Human(DaTime)
   xyear= ItemExtract(1,DaTime,":")
   xmonth=ItemExtract(2,DaTime,":")
   xday=  ItemExtract(3,DaTime,":")
   xhour= ItemExtract(4,DaTime,":")
   xmin=  ItemExtract(5,DaTime,":")
   xsec=  ItemExtract(6,DaTime,":")
   AMPM="AM"
   If hour>=12 Then AMPM="PM"
   If xhour>=13 Then xhour=xhour-12
   newtime=StrCat(xmonth,"/",xday,"/",xyear," ",xhour,":",xmin,":",xSec," ",AMPM)
   Return (newtime)
#EndFunction



xxx="2004:02:19:12:30:01"
hhh=YmdHms2Human(xxx)
Message(xxx,hhh)



Article ID:   W14752
Filename:   YMDHMS to normal date conversion.txt
File Created: 2004:02:20:11:08:34
Last Updated: 2004:02:20:11:08:34