The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: msmith on January 14, 2006, 03:52:11 AM

Title: Time Formatting
Post by: msmith on January 14, 2006, 03:52:11 AM
Are there any formating functions in the API to format Systime and LocalTime into ASCII format?

This woundn't be that difficult, but why "roll your own" if they already exist>
Title: Re: Time Formatting
Post by: P1 on January 14, 2006, 04:42:18 AM
Unless you call into a runtime library of HLL, I have not seen a MASM/ASM library of Time/Date functions.

I have rolled my own for my programs.

Regards,  P1  :8)
Title: Re: Time Formatting
Post by: farrier on January 14, 2006, 05:31:40 AM
msmith,

Try:

GetTimeFormat
GetDateFormat

hth,

farrier
Title: Re: Time Formatting
Post by: msmith on January 14, 2006, 06:12:15 AM
Thanks to all.

Ironically, there is no reference to these functions in the Time Functions page nor in any of the separate Time Function pages in my MSDN.
Title: Re: Time Formatting
Post by: GregL on January 14, 2006, 06:16:38 AM

GetTimeFormat (http://msdn.microsoft.com/library/en-us/intl/nls_6at0.asp?frame=true)

GetDateFormat (http://msdn.microsoft.com/library/en-us/intl/nls_5w6s.asp?frame=true)
Title: Re: Time Formatting
Post by: MichaelW on January 14, 2006, 07:55:27 AM
 MSDN: Run-time Library Reference, Locale (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_locale.asp)


Title: Re: Time Formatting
Post by: msmith on January 17, 2006, 07:06:17 AM
Thanks to all.

GetTimeFormat and GetDateFormat are slightly on the overkill side, but work very well for me. If I had written my own I wouldnn't have had so many options, but someone using my compiler may find good use for the options.

Mike