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 8562473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:44:15+00:00 2026-06-11T16:44:15+00:00

I was parsing a Reddit RSS feed and noticed that the time was in

  • 0

I was parsing a Reddit RSS feed and noticed that the time was in UTC. The server is located in the EST. The server is located in the timezone that is -5hrs from the UTC. How do I convert the UTC timecode to EST?

Note: I also read that UTC doesn’t follow daylight savings time (DST), I’ll figure out whether to adjust the hour difference later on by using date ranges.

Reddit item node in rss feed

<item>
<title>blah blah</title>
<link>http://blah.com</link>
<guid isPermaLink="true">http://www.reddit.com/r/blah/comments/blah</guid>
<pubDate>Sun, 16 Sep 2012 21:39:17 -0700</pubDate>
<description>blah description</description>
</item>

I came up with this so far:

DECLARE @d DATETIMEOFFSET;
SET @d = 'Sep 2012 21:39:17 -07:00'

DECLARE @off datetime
SET @off = SWITCHOFFSET(@d, '-05:00')

DECLARE @dates TABLE (
converteddate DATETIME
);

insert into @dates (converteddate)
Values (@off)

select * from @dates
  • 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-06-11T16:44:16+00:00Added an answer on June 11, 2026 at 4:44 pm

    My example seems to be the answer from what I’ve read. IF you offset the UTC time by the server’s UTC time offset you get the local time of the server. In this particular case, the server is UTC -05:00

    In this example the pubDate’s node is:

    Sun, 16 Sep 2012 21:39:17 -0700
    

    I parse the Reddit RSS feed and send the pubDate node as text to SQL. I reformatted the pubDate’s string to this:

    Sep 2012 21:39:17 -07:00
    

    The stored procedure I came up with:

    --@pubdate was sent to SQL from web app as 'Sep 2012 21:39:17 -07:00'
    
    @pubdate varchar(50)
    
    DECLARE @d DATETIMEOFFSET;
    SET @d = @pubdate
    
    DECLARE @off datetime
    SET @off = SWITCHOFFSET(@d, '-05:00')
    
    INSERT INTO feed (pubdate)
    VALUES (@off)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When parsing dates in different time zones I noticed that NSDateFormatter produces strange results
I'm parsing a date from a JSON event feed - but the date shows
I am parsing an XML feed from Google using beautifulstonesoup and python, and it
I'm working on simple Haskell programme that fetches a JSON string from a server,
When parsing the <description> tags found in several RSS feeds, I'm noticing that if
Not parsing the parameters in the beginning but parse the input string read from
I am parsing two json feeds. The first json feed parses pharmacies of a
Parsing a 20MB file that is too large to do in one piece on
Parsing some data and inserting it into 3 tables from .NET. Using Table Valued
When parsing a PDF, given a string (popped from the Tj or TJ operator

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.