Re: Date/Time format codes

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Date/Time format codes

Rik-4
On 04/06/2016 06:49 AM, [hidden email] wrote:
Subject:
How to get default/local Date/Time patterns?
From:
"Denis S." [hidden email]
Date:
04/06/2016 02:49 AM
To:
[hidden email]
List-Post:
[hidden email]
Precedence:
list
MIME-Version:
1.0
Message-ID:
[hidden email]
Content-Type:
multipart/alternative; boundary="----=_Part_70246_657494528.1459936150076"
Message:
8

Dear all, Problem: How can I get default/local Date/Time patterns/formats? There are a lot of functions that use format as input parameter: datenum ("datestr", format); datestr (DATE, format); ... But which function returns format as output parameter. For example, in powershell I can get it like that: PS H:\>(Get-Culture).DateTimeFormat.ShortDatePattern yyyy-MM-dd PS H:\> (Get-Culture).DateTimeFormat.ShortTimePattern HH:mm

Try 'help datevec'.  From the documentation for datevec:

   If F is a format string, the following symbols are recognized:

     Symbol  Meaning                                            Example
     --------------------------------------------------------------------------
     yyyy    Full year                                          2005
     yy      Two-digit year                                     05
     mmmm    Full month name                                    December
     mmm     Abbreviated month name                             Dec
     mm      Numeric month number (padded with zeros)           01, 08, 12
     m       First letter of month name (capitalized)           D
     dddd    Full weekday name                                  Sunday
     ddd     Abbreviated weekday name                           Sun
     dd      Numeric day of month (padded with zeros)           11
     d       First letter of weekday name (capitalized)         S
     HH      Hour of day, padded with zeros if PM is set        09:00
             and not padded with zeros otherwise                9:00 AM
     MM      Minute of hour (padded with zeros)                 10:05
     SS      Second of minute (padded with zeros)               10:05:03
     FFF     Milliseconds of second (padded with zeros)         10:05:03.012
     AM      Use 12-hour time format                            11:30 AM
     PM      Use 12-hour time format                            11:30 PM

--Rik