Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6541489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:06:41+00:00 2026-05-25T11:06:41+00:00

I am working with an XslCompiledTransform object and try to parse a DateTime object.

  • 0

I am working with an XslCompiledTransform object and try to parse a DateTime object. It works but only shows the GMT date.
When I debug the code, the object has the correct value (GMT+2)

I am using this in the XSLT:

ms:format-time(order/@orderDate, 'H:m', 'NL-nl')

The output has a two hour difference with the correct value.
Can this be solved using XSLT 1.0 and the default .Net 4 framework methods. (C#)

Edit: Can this be solved without adding code to the XSLT https://groups.google.com/d/topic/microsoft.public.xsl/1mPHhh6F62o/discussion

Edit2: Seems that more people have problems with formatting time in XSLT 1 With different timezones: http://forums.tizag.com/showthread.php?t=17429

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:06:41+00:00Added an answer on May 25, 2026 at 11:06 am

    Ok, here it the top of my XSLT:

    <?xml version="1.0" encoding="UTF-8" ?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:ms="urn:schemas-microsoft-com:xslt"
                xmlns:dt="urn:schemas-microsoft-com:datatypes"
                xmlns:user="urn:my-scripts">
        <xsl:decimal-format name="euro" decimal-separator="," grouping-separator="."/>
        <ms:script language="C#" implements-prefix="user">
        <![CDATA[              
             public string correctTime(DateTime dt)
             {
                return dt.ToLocalTime().ToString("HH:mm");
             }
        ]]>
        </ms:script>
        <xsl:template match="/">
        ...
    

    and further down the XSLT some HTML markup and using the method mentioned above:

    <tr>
        <td>Tijd:</td>
        <td>
            <xsl:value-of select="user:correctTime(order/@datum)"/>
        </td>
    </tr>
    

    Holland has now (because of daylight saving time) GMT + 2
    without the use of this method it just converted my value to GMT
    So there was a 2 hour difference. The 1 hour difference we had before wasn’t noticed. But because it is now 2 hour, it got to our attention 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm transforming xml using the following code. It works fine for one xslt but
Working SQL The following code works as expected, returning two columns of data (a
Working with spring, below, the code of applicationContext-service.xml: <bean id=mediaObjectService class=path.MediaObjectServiceImpl> <property name=mediaObjectDao >
working on an old translation sample code for windows phone 7. Recently, I have
Working with COM interop, I can call a managed function from within unmanaged code.
Working with MVC3, Razor, Jquery, Javascript. The below code loops through and displays a
Working with dates in ruby and rails on windows, I'm having problems with pre-epoch
Working with a SqlCommand in C# I've created a query that contains a IN
Working on a project at the moment and we have to implement soft deletion
Working on a somewhat complex page for configuring customers at work. The setup is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.