5

What is the right way to format xs:dateTime to RFC 822?

0

3 Answers 3

5

You need fn:format-dateTime

I think it should be:

format-dateTime(current-dateTime(),
                '[FNn,*-3], [D01] [MNn,*-3] [Y0001] [H01]:[m01]:[s01] [Z]',
                'en',
                '',
                'US')

Right now, for me, output:

Thu, 07 Oct 2010 21:10:03 -03:00
Sign up to request clarification or add additional context in comments.

Comments

2

Yup. I added 'AD' as the calendar and that cleaned up the output using SaxonHE 9.3.0.5

fn:format-dateTime(current-dateTime(),
            '[FNn,*-3], [D01] [MNn,*-3] [Y0001] [H01]:[m01]:[s01] [Z]',
            'en',
            'AD',
            'US')

Comments

0

In XSL:

<xsl:value-of select="concat(ms:format-date(InputDate, 'ddd, dd MMM yyyy'), ' ', ms:format-time(InputDate, 'HH:mm:ss'), ' EST')"/>

When date was retrieved from database as:

 SELECT
      Table.DateField AS InputDate
    FROM Table 

or try : SELECT CONVERT(NVARCHAR(10), Table.DateField, 101) AS InputDate FROM Table

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.