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

  • SEARCH
  • Home
  • 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 5950639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:25:20+00:00 2026-05-22T17:25:20+00:00

I’m placed in a situation where my program has 2 integrations towards 3rd party

  • 0

I’m placed in a situation where my program has 2 integrations towards 3rd party systems. The integrations consists of 1) XML protocol over TCP/IP and 2) Webservices made in WCF.

In either case the integration partner needs the TimeStamps / DateTimes I pass to them to contain information about the TimeZone and Daylight Savings, so they can display the correct time regardless of their customers TimeZone / Position.

I’d rather not change the current protocol, in either cases they expect DateTime, so my question is: Is it possible to pass the TimeZone and Daylight Savings information as a part of the DateTime?

Right now my timestamps looks like this:

2011-04-27T15:14:13.963

I would love to have it look something like this (I’m located in Denmark so we use CEST) and be able to transfer the information with a DateTime object

 2011-04-27T15:14:13.963 +01:00

However I do not know how I should accomplish this nor take into account the Daylight Savings Factor

  • 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-22T17:25:21+00:00Added an answer on May 22, 2026 at 5:25 pm

    Use UTC time and you can stick with DateTime. UTC is converted to local (or any other time) in-place. Also this solves problem with Daylight Saving Time. Using UTC is the best solution, I have had some expirience with it.

    Small demo:

    namespace TimeZoneTest
    {
      using System;
      using System.Globalization;
    
      class Program
      {
          static void Main(string[] args)
          {
              // get local time
              DateTime localTime = DateTime.Now;
              Console.WriteLine(string.Format(
                  CultureInfo.CurrentCulture, 
                  "localTime = {0}, localTime.Kind = {1}", 
                  localTime, 
                  localTime.Kind));
    
              // get local time zone, or use TimeZoneInfo to get any time zone you want
              TimeZone ltz = TimeZone.CurrentTimeZone;
              Console.WriteLine(string.Format("local time zone = {0}", ltz.StandardName));
    
              // convert local time to UTC
              DateTime utcTime = ltz.ToUniversalTime(localTime);
              Console.WriteLine(string.Format(CultureInfo.CurrentCulture,
                  "utcTime = {0}, utcTime.Kind = {1}",
                  utcTime,
                  utcTime.Kind));
    
              // transfer date via service, as ISO time string
              string isoUtc = utcTime.ToString("o");
              Console.WriteLine("...");
              Console.WriteLine(string.Format("transfer: isoUtc = {0}", isoUtc));
              Console.WriteLine("...");
    
              // now on the other side
              DateTime utcTimeRecieved = DateTime.ParseExact(
                  isoUtc, 
                  "o", 
                  CultureInfo.InvariantCulture, 
                  DateTimeStyles.RoundtripKind);
              Console.WriteLine(string.Format(CultureInfo.CurrentCulture, 
                  "utcTimeRecieved = {0}, utcTimeRecieved.Kind = {1}", 
                  utcTimeRecieved, 
                  utcTimeRecieved.Kind));
    
              // client time zone, or use TimeZoneInfo to get any time zone you want
              TimeZone ctz = TimeZone.CurrentTimeZone;
              Console.WriteLine(string.Format("client time zone = {0}", ctz.StandardName));
    
              // get local time from utc
              DateTime clientLocal = ctz.ToLocalTime(utcTimeRecieved);
              Console.WriteLine(string.Format(
                  CultureInfo.CurrentCulture,
                  "clientLocal = {0}, clientLocal.Kind = {1}",
                  clientLocal,
                  clientLocal.Kind));
    
              Console.WriteLine("\nPress any key to exit..");
              Console.ReadKey();
          }
      }
    

    }

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm parsing an XML file, the creators of it stuck in a bunch social
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

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.