octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date/Time format codes


From: Rik
Subject: Re: Date/Time format codes
Date: Wed, 6 Apr 2016 08:29:48 -0700

On 04/06/2016 06:49 AM, address@hidden wrote:
Subject:
How to get default/local Date/Time patterns?
From:
"Denis S." <address@hidden>
Date:
04/06/2016 02:49 AM
To:
address@hidden
List-Post:
<mailto:address@hidden>
Precedence:
list
MIME-Version:
1.0
Message-ID:
<address@hidden>
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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]