View unanswered posts | View active topics

Reply to topic  [ 12 posts ] 

Joined: Fri Jan 20, 2006 12:46 am
Posts: 20
Post Timestamp Parameter Format
The standard item template parameter ITEM-TIMESTAMP creates a date format that is friendly but can be difficult to use. For example, if you generate a HTML report with that parameter, the output is relative to the report generation date instead of absolute.

For example:

Published: 17:36
Published: Yesterday 22:20

I would much prefer an option for a standard date / time format such as:

mm/dd/yy hh:mm
or just
mm/dd/yy

Does that already exist? Could it be added as a separate standard item parameter?

Also, the "Published: " isn't necessary, as that could be part of the template instead of built into the parameter. Thanks for the help.


Thu Feb 02, 2006 6:55 am
Profile
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2897
Location: Melbourne, Australia
Post Re: Timestamp Parameter Format
jonahviakeyboard wrote:
I would much prefer an option for a standard date / time format such as:

mm/dd/yy hh:mm
or just
mm/dd/yy

Does that already exist? Could it be added as a separate standard item parameter?

Good point. Unfortunately there's no way to get this right now but I'll add a new template parameter for you.

jonahviakeyboard wrote:
Also, the "Published: " isn't necessary, as that could be part of the template instead of built into the parameter. Thanks for the help.


Timestamping of feed items is one of many messy issues when it comes to handling RSS and Atom feeds. RSS items can be marked with a <i>published date</i> although not everyone uses it. Atom items can be tagged with various combinations of <i>modified</i>, <i>issued</i>, and <i>created</i> times. Awasu also tracks what time each feed item was received.

Munging all these together into a single format is fiddly - Awasu chooses the most appropriate one and shows it as the <i>Last changed</i>, <i>Published</i> or <i>Received</i> time.


Thu Feb 02, 2006 7:39 am
Profile WWW

Joined: Fri Jan 20, 2006 12:46 am
Posts: 20
Post 
Thanks so much for the quick response!

I didn't realize so much went into the timestamp. Awasu's selection of date source (published/modified/issued/created) and choice of prefix (last changed/published/received) are all fine by me.

It's only the date format that I'm after. Actually, I'd love to see another timestamp parameter that didn't have the prefix at all - just the standard format date. Thanks as always.


Thu Feb 02, 2006 1:46 pm
Profile
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2897
Location: Melbourne, Australia
Post 
jonahviakeyboard wrote:
Actually, I'd love to see another timestamp parameter that didn't have the prefix at all - just the standard format date.


Unfortunately, there is no such thing as a "standard format" when it comes to dates and times. We are an Australian company and while we try to use American spelling, etc. throughout, we are loathe to force everyone to use the American-style date format of MM/DD/YY :-)

I'm thinking about adding some new template parameters called ITEM-PUBDATE-TIMET, ITEM-TIMEMODIFIED-TIMET, ITEM-TIMERECEIVED-TIMET and ITEM-TIMESTAMP-TIMET. The first three are the <i>published</i>, <i>modified</i> and <i>received</i> times mentioned earlier while the last one is the one that Awasu chooses to be the most appropriate to show the user.

These will mirror the existing template parameters except that they will be numeric time_t values (i.e. number of seconds since Jan 1 1970). From these, you can then present the date/time values in any format you want.

Also, let us know what edition of Awasu you're using and we'll get a special build out to you.


Mon Feb 27, 2006 4:19 am
Profile WWW
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2897
Location: Melbourne, Australia
Post 
OK, I've been meaning to make some changes to the template processing code for ages now but have been putting it off because it's pretty boring work :oops:. This gave me the excuse to actually dive in and do it :-)

The existing parameters (ITEM-PUBDATE, ITEM-TIMEMODIFIED, ITEM-TIMERECEIVED and ITEM-TIMESTAMP) still work the same way they have before i.e. they will insert a "friendly" date/time string.

However, you can now add a strftime()-style parameter to control the format of the date/time string. So, to get your date/time strings to look like MM/DD/YY HH:MM, you would use something like {%ITEM-TIMESTAMP% "%m/%d/%y %H:%M"}. The quotes are needed since there is a space in the format string.


Tue Feb 28, 2006 6:21 am
Profile WWW

Joined: Thu Mar 08, 2007 11:21 am
Posts: 42
Post 
I'm running version 2.2.

Glad to hear the date/time can be formated as follows :)
{%ITEM-TIMESTAMP% "%m/%d/%y %H:%M"}

Unfortunatly the following will not work for me: :?:
{%ITEM-TIMERECEIVED% "%m/%d/%y %H:%M"}

Any sugestions?

Thanks in advance.

Vidconf


Mon Mar 12, 2007 11:26 pm
Profile
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2897
Location: Melbourne, Australia
Post 
vidconf wrote:
Unfortunatly the following will not work for me: :?:
{%ITEM-TIMERECEIVED% "%m/%d/%y %H:%M"}

This formatting feature was added after 2.2 was released. You can either upgrade to the latest beta release (2.3.rc2) but you will have to go through all the intervening beta releases so it'll be a bit of a slog or you can wait a few weeks for 2.3 to be released which will have an installer that does it all for you.

Also, do you specifically want the time the item was received? This is a deprecated parameter and will be dropped soon.


Tue Mar 13, 2007 12:37 am
Profile WWW

Joined: Thu Mar 08, 2007 11:21 am
Posts: 42
Post 
Thanks for the quick reply. :D

I'll give 2.3 rc2 a try.

I'll be using
{%ITEM-TIMERECEIVED% "%m/%d/%y %H:%M"} as feeds generated from Webscrape do not have other Items (for data/time)

Unless: I can dynamically insert a date stamp in the report indepandant of the feed ITEMS?

Cheers
Vidconf


Tue Mar 13, 2007 7:57 am
Profile
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2897
Location: Melbourne, Australia
Post 
vidconf wrote:
Unless: I can dynamically insert a date stamp in the report indepandant of the feed ITEMS?

<tt>{%REPORT-TIME%}</tt> will give you the time at which the report was generated.


Tue Mar 13, 2007 8:15 am
Profile WWW

Joined: Thu Mar 08, 2007 11:21 am
Posts: 42
Post 
{%REPORT-TIME%} will not work in my case.

I have a report that generates an html file (from multiple feeds) for ftp upload.

I use Webscrape to generate the feeds and no ITEM (DATA/Time) is available.

The report is a simple table:

"Headline" "Source" "Date/Time"

The table is able to manually/auto sort on any column using dhtml.

The "Date/Time" column I need is when the Webscrape has colleceted the feed items. Therefore I use {%ITEM-TIMERECEIVED% }.

The end goal is for a report from mulitple feeds with feed items auto sorted newest first.

I'll try 2.32 rc2 tonight. If it works I hope you don't drop support for {%ITEM-TIMERECEIVED% "%m/%d/%y %H:%M"}

Vidconf


Tue Mar 13, 2007 9:03 am
Profile

Joined: Mon Apr 11, 2011 1:18 pm
Posts: 1
Post Re: Timestamp Parameter Format
I think it would be great if there were a way to customize the time stamp. This seems like it would be simple enough, but apparently, this is not the case. In my office, there tends to be a lot of confusion regarding the time stamp, especially with the new guys. It would be nice if there was a simple solution to this, but I suppose it is just something we all have to live with.

_________________
Read today, Lead tomorrow.
scanpst.exe


Fri Apr 22, 2011 7:49 pm
Profile
Site Admin
User avatar

Joined: Fri Feb 07, 2003 8:48 am
Posts: 2897
Location: Melbourne, Australia
Post Re: Timestamp Parameter Format
flyinggypsy wrote:
I think it would be great if there were a way to customize the time stamp.

Add a format="..." parameter where ... is a strftime-style format string e.g. {%ITEM-METADATA% published format="%Y-%m-%dT%H:%M:%SZ"}

Search through the files in the $/Resources directory for other examples.


Fri Apr 22, 2011 8:07 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 12 posts ] 

Who is online
Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron