Default Date Conversion and Display Format

You can set your own default date conversion and display format using the _data_fmt private method.

Sybase date format depends on the locale settings for the client. The default date format is based on the 'C' locale:

Feb 16 2012 12:07PM

Under this same default locale, Sybase understands several additional input formats:

  • 2/16/2012 12:07PM
  • 2012/02/16 12:07
  • 2012-02-16 12:07
  • 20120216 12:07

Use _date_fmt() (accessible using $dbh->func()) to change the date input and output format.

Support Date Formats
Date format Example
LONG Nov 15 2011 11:30:11:496AM
SHORT Nov 15 2011 11:30AM
DMY4_YYYY Nov 15 2011
MDY1_YYYY 11/15/2011
DMY1_YYYY 15/11/2011
DMY2_YYYY 15.11.2011
DMY3_YYYY 15-11-2011
DMY4_YYYY 15 November 2011
HMS 11:30:11
LONGMS Nov 15 2011 11:30:33.532315PM

Adaptive Server Enterprise database driver for Perl supports all date and time values supported up to version 15.7.