Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-12-28 00:54:31

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Windows IIS & strftime()

a long-time annoyance on Windows server was no support for the strftime format “%e” – day of the month as a decimal number (single digit, e.g. January 3, 2007)

had to use “%d” – day of the month as a decimal number (range 01 to 31, e.g. January 03, 2007)

but courtesy Zem, here’s a workaround…

As said in these comments, Windows strftime() doesn’t support e. However, to achieve a similar effect (not 100) you can use %#d. The # flag will remove the leading zero, so you do get single digits, but without the space that would be added by %e in other environments.

- http://au.php.net/manual/en/function.strftime.php#46315

Offline

#2 2007-06-12 05:24:26

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: Windows IIS & strftime()

Again on IIS or on any platform – anyone know how to get the hour without a leading “0”?

Using %I gives a leading zero e.g. *07*:30am

%I - hour as a decimal number using a 12-hour clock (range 01 to 12)

Offline

#3 2007-06-12 08:03:17

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Windows IIS & strftime()

Use: %#I

Offline

#4 2007-06-12 09:11:28

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: Windows IIS & strftime()

d’oh – thought I’d tried that to no avail – but you’re right

thanks ruud

Offline

#5 2007-06-12 09:19:45

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Windows IIS & strftime()

In case anyone else is looking for other strftime format codes that can be used on Windows: visit this page

Last edited by ruud (2007-06-12 09:21:45)

Offline

Board footer

Powered by FluxBB