Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-02-13 22:27:19

John Wozniak
Member
Registered: 2006-10-20
Posts: 37

How do I create a date format and display like...

on this site?

With something like this for code:
<p class=“post-info”><abbr class=“published” title=“2007-01-10T19:29Z”><em>10</em> JAN</abbr></p>

Thanks in advance.

Last edited by John Wozniak (2007-02-14 23:35:32)

Offline

#2 2007-02-13 22:45:16

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How do I create a date format and display like...

<div class="date">
<div class="day"><txp:posted format="%e" /></div>
<div class="month"><txp:posted format="%b" /></div>
</div>

and style the classes in your CSS :)

edit: forgot something… wrap it in

<abbr class="published" title="<txp:posted format="..." />">...</abbr>

(please find the right format here)

Last edited by els (2007-02-13 22:54:59)

Offline

#3 2007-02-13 23:02:10

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How do I create a date format and display like...

Looks like I wasn’t fast enough… but I had already typed it so I’m posting it anyway. :D

<p class="post-info"><abbr class="published" title="<txp:posted format="%Y-%m-%dT%H:%MZ" />"><em><txp:posted format="%d" /></em> <txp:posted format="%b" /></abbr></p>

Just remember that if you stick with a straight Z that you should use the gmt attribute of posted.

Offline

#4 2007-02-14 00:22:14

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: How do I create a date format and display like...

FYI: <txp:posted format="w3cdtf" />, <txp:posted format="rfc822" />.


Alex

Offline

#5 2007-02-14 05:29:50

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: How do I create a date format and display like...

I think EST is GMT -5, so head to admin>prefs and set it as such.

Offline

#6 2007-02-14 15:16:07

John Wozniak
Member
Registered: 2006-10-20
Posts: 37

Re: How do I create a date format and display like...

Now that I am awake (god bless coffee) I see Mary provided links to explain that:
The time zone designator is one of:

Z indicates UTC (Coordinated Universal Time). The “Z” must be uppercase.
+hh:mm indicates that the time is a local time which is hh hours and mm minutes ahead of UTC.
-hh:mm indicates that the time is a local time which is hh hours and mm minutes behind UTC.

Exactly the components shown here must be present, with exactly this punctuation. Note that the “T” appears literally in the string (it must be uppercase), to indicate the beginning of the time element, as specified in [ISO8601]

If a generating application does not know the time to the second, it may use the value “00” for the seconds (and minutes and hours if necessary).

———————

So maybe this Universal Coordinated Time is the way to go – or not…

Can anyone clarify?

This what I have so far based upon the feedback above:
<p class=“post-info”><abbr class=“published” title=”<txp:posted gmt=“1” format=”%Y-%m-%dT%H:%MZ” />”><txp:posted format=”%b” /><em> <txp:posted format=”%d” /></em></abbr></p>

All I did was add gmt=“1” to the title per Mary’s suggestion. I spose if I don’t get it I shouldn’t use it but the only thing I don’t understand is why I should use Z time or not and/or how I should represent it best for all users.

Last edited by John Wozniak (2007-02-14 23:01:05)

Offline

#7 2007-02-15 02:32:25

John Wozniak
Member
Registered: 2006-10-20
Posts: 37

Re: How do I create a date format and display like...

Thanks for everyone’s help.

I am not sure I have this totally sorted out but I have learned a lot about timezones, time keeping and UTC vs GMT vs Atomic time and so on (Wikipedia rocks!).

Since I am in NYC, it would seem to make sense to use ET or EST over GMT, UTC or Z time (much of what I publish will be focused on Brooklyn and the NYC area).

Damn, that was a lot of acronyms for one sentence :Q.

I decided on ET since that seems the most inclusive and won’t need to be changed with the seasons.

Anyone had to make similar decisions? What did you do?

Offline

#8 2007-02-15 09:20:39

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: How do I create a date format and display like...

I’ve been using GMT/UTC on my personal site.

Last edited by Mary (2013-01-24 17:22:10)

Offline

Board footer

Powered by FluxBB