FutureBasic Logo

<<    Index    >> FutureBasic 5

date$( deprecated in 5.7.115 )/DateCFString   functions



Syntax:
   date$ [( formatPascalString )] is deprecated. Recommend DateCFString
   DateCFString [( formatCFString )]

Description:
   date$/DateCFString are functionally equivalent with these differences:    date$/DateCFString returns a string based on the current date. 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 )

Example:
  NSLog( @"%@", fn DateCFString( @"" ) ) //Use empty string for default format MM/dd/yy
  NSLog( @"%@", fn DateCFString(@"MMMM d, yyyy") )
  NSLog( @"This is day %@ of the year", fn DateCFString(@"D") )

  04/01/18
  April 1, 2018
  This is day 91 of the year

See Also:
time$; Appendix I - Data & Time Symbols