Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 16th, 2010, 04:02 PM
Authorized User
 
Join Date: Apr 2008
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default EST in date time format

Hi,

I am trying to format the date into the RFC-822.

The current format I have is 2010-04-09T11:51:20.776-04:00

I am trying to convert it to format Fri, 09 Apr 2010 14:54:49 EST

I have tried with format-time($t, "[h]:[m01]:[s01] [PN] [ZN,*-3]", "en", (), ())

but it was not giving the EST at the end but shows -4:00

Please suggest me to converthe date in the required format

thanks
 
Old April 16th, 2010, 04:14 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I thought EST was -05:00? Surely your example is EDT?

(Excuse me if I'm wrong. I'm not American.)
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old April 16th, 2010, 04:30 PM
Authorized User
 
Join Date: Apr 2008
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Michael,

Even I am not sure. This is surely for EST and the difference might be because of day light saving.

But my problem is to get "EST" in the format without that -4 or -5

Required format "Fri, 09 Apr 2010 14:54:49 EST"

Last edited by bsridharg; April 16th, 2010 at 04:35 PM..
 
Old April 16th, 2010, 04:36 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

More generally, it's likely to depend on the product you are using. Saxon does have some facilities to output time zone names, but it's all rather dependent on geography. Start by specifying "us" as the "country" parameter, and see what you get. It will probably work OK if your timezone is a US one, but not otherwise. RFC 822 only allows a very limited number of timezone names (GMT plus the US ones - wow, this is a dated standard!), so you run the risk that Saxon will output one that isn't allowed by RFC 822. It would probably be safer to obtain the timezone programmatically (timezone-from-dateTime()), and format it yourself. Alternatively, RFC 822 allows -0400 (no colon), so why not use that?
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old April 18th, 2010, 02:26 AM
Authorized User
 
Join Date: Apr 2008
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I am using the one with ":" and formatted it to remove : thanks.





Similar Threads
Thread Thread Starter Forum Replies Last Post
date time format vb certified Pro VB 6 4 December 18th, 2009 08:16 AM
date and time in EST time zone anboss XSLT 1 May 21st, 2008 01:42 PM
Behavior of Date/Time Format Differs When Accessed Oliver Dempsey Classic ASP Basics 25 May 2nd, 2005 01:24 AM
Format Date to time field KennethMungwira VB.NET 3 November 17th, 2003 11:48 AM
Format Date Time ganesh15 PHP How-To 2 August 20th, 2003 05:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.