options:xml:time-format

Time Format

You can define format in which date time is inserted into documents.

As default you will find in menu Edit→Insert Date/Time the follow formats to insert into your document:

  • 07.03.2009 19:54
  • 07.03.09 07:55 PM
  • 03/07/09 19:55:14
  • Saturday, March 07, 2009 19:55:27
  • Saturday, March 07, 2009

but if you like you can change (or extend) these formats by direct modification of syntax spec file. The formats you see by default defined in file def_spec.xml (Default syntax), but you can also add/move them to any spec file you want to be extended. The following line in def_spec.xml should changed:

<InsertDateTime>
   <Insert format="%d.%m.%Y %H:%M"/>        <!-- 07.03.2009 19:54                 -->
   <Insert format="%d.%m.%y %I:%M %p"/>     <!-- 07.03.09 07:55 PM                -->
   <Insert format="%c"/>                    <!-- 03/07/09 19:55:14                -->
   <Insert format="%#c"/>                   <!-- Saturday, March 07,2009 19:55:27 -->
   <Insert format="%#x"/>                   <!-- Saturday, March 07, 2009         -->
</InsertDateTime>

For example to add two additional formats, add this two lines between '<InsertDateTime>…</InsertDateTime>':

<InsertDateTime>
...
  <Insert format="%#d.%#m.%Y %#H:%M"/>       <!-- 7.3.2009 20:11  -->
  <Insert format="%#d.%#m.%y %#I:%M %p"/>    <!-- 7.3.09 8:11 PM  -->
</InsertDateTime>

A complete list of formatting option can be found on MSDN web site, here is small snapshot:

  %a        Abbreviated weekday name
  %A        Full weekday name
  %b        Abbreviated month name
  %B        Full month name
  %c        Date and time representation appropriate for locale
  %d        Day of month as decimal number (01 – 31)
  %H        Hour in 24-hour format (00 – 23)
  %I        Hour in 12-hour format (01 – 12)
  %j        Day of year as decimal number (001 – 366)
  %m        Month as decimal number (01 – 12)
  %M        Minute as decimal number (00 – 59)
  %p        Current locale's A.M./P.M. indicator for 12-hour clock
  %S        Second as decimal number (00 – 59)
  %U        Week of year as decimal number, with Sunday as the first day of week (00 – 53)
  %w        Weekday as decimal number (0 – 6; Sunday is 0)
  %W        Week of year as decimal number, with Monday as the first day of week (00 – 53)
  %x        Date representation for current locale
  %X        Time representation for current locale
  %y        Year without century, as decimal number (00 – 99)
  %Y        Year with century, as decimal number

How to change default date time format in HippoEDIT

#xml_option