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

TimeForm

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

TimeForm Extender

 Keywords:  

The TimeForm extender returns a time in any format you wish.

[tform34i.zip]

Author:
   Alan Kreutzer

Version:
   20010523
   FILEVERSION 10000
   PRODUCTVERSION 10000

Download:
   tform34i.zip  30 KB

Usage:
   AddExtender("TForm34i.dll")

-------------------------------------------------------------------------------



The TimeForm extender returns a time in any format you wish.

To load the extender...   AddExtender(TForm34i.dll")
There are two function calls...

     NowFormat("format")
     TimeFormat(YmdHms,"Format")

	where    "Format"   is a string describing the format the
                          date is to be returned in.

                 YmdHms   is a date /time in WinBatch format (YYYY:MM:DD:HH:MM:SS) 
                          (Four digit years are recommended.  Two digit years are
                          assumed to be 20xx)


Both routines return a string containing the date,
formated as directed by the "Format".


The format can contain any characters. The routines look for
certain key strings and replace them with information from the
date.  NOTE:  KEY STRINGS ARE CASE SENSITIVE.

The key strings are...


                This     Is replaced by
                ----     -----------------------------------
(Upper Case)    MMMM     Full Month Name
                MMM      Abbreviated Month Name
                MM       Month as a two digit number
                DDDD     Full Weekday name
                DDD      Abbreviated Weekday name
                DD       Day of the month as a two digit number
                YYYY     Four Digit year
                YY       Two Digit Year
                HH       Hour (24 hour format) as a two digit number
(Lower Case)    hh       Hour (12 hour format) as a two digit number
                mm       Minutes as a two digit number
                ss       Seconds as a two digit number
(Upper Case)    AM       AM/PM  (Upper case)
(Lower Case)    am       am/pm  (Lower case)
(Upper Case)    ZM       Two digit month with leading zero suppressed
                ZD       Two digit day of the month with leading zero suppressed.
                ZH       Two digit hour (24 hour format) leading zero suppressed.
                zh       Two digit hour (12 hour format) leading zero suppressed.
(Lower Case)    zm       Two digit minute with leading zero suppressed
                zs       Two digit second with leading zero suppressed
(Upper Case)    JJJ      Julian Day  - Day of the year as a three digit number

             Note that JJJ does NOT return the same value as the Winbatch function
             TimeJulianDay().  TimeJulianDay() returns the number of days since the 
             year 1AD, but NowFunction("JJJ") returns the number of days since 
             the beginning of this year. 
       


Any other characters in a Format will be passed to the
output string unchanged.  This is useful for putting 
punctuation in a date...   MM/DD/YYYY  HH:mm:ss


Examples...

     NowFormat("DDDD, MMMM DD, YYYY")  

              would return a date like this.....   "Saturday, January 01, 2000"

     NowFormat("hh:mm:ss am")   

              would return.....   "05:15:33 pm"

     TimeFormat("YYYYMMDD",FileYmdHms(aFileName))

	      Would return a file date like this... "20010131"



Article ID:   W16875
File Created: 2019:08:14:08:57:58
Last Updated: 2019:08:14:08:57:58