FutureBasic Logo

<<    Index    >> FutureBasic 5

time$( deprecated in 5.7.115 )/TimeCFString   functions

   time$ [( formatPascalString )] is deprecated. Recommend TimeCFString
   TimeCFString [( formatCFString )]

   time$/TimeCFString are functionally equivalent with these differences:    time$/TimeCFString returns a string based on the current time. A formatPascalString or formatCFString controls output formatting.

   The formatPascalString or formatCFString must contain Unicode Date and Time symbols as shown below and found in Appendix I - Data & Time Symbols.

   If a pascal string date is needed, the returned CFString may be converted with: fn CFStringGetPascalString( cfString, @pascalStr, 256, _kCFStringEncodingMacRoman )

  NSLog( @"%@", fn TimeCFString( @"" ) ) //Use empty string for default format HH:mm:ss
  NSLog( @"%@", fn TimeCFString(@"hh:mm:ss") )
  NSLog( @"%@", fn TimeCFString(@"h:mm a") )
  NSLog( @"%@", fn TimeCFString(@"h:mm a zzz") )

  11:04 PM
  11:04 PM MST

See Also:
date$/DateCFString; Appendix I - Data & Time Symbols