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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:55:27+00:00 2026-06-07T15:55:27+00:00

My goal is to create a time zone converter that will compare two different

  • 0

My goal is to create a time zone converter that will compare two different date field inputs from a pdf form to decide which array to send to my function that populates the drop down lists. One array has UTC offsets for DST and the other has UTC offsets disregarding DST. I first tried to write a conditional statement that checked the date against a static date but this would have to be amended every year. Is there a way to take advantage of javascript to make this an easier process? Ideally I’d like a self adjusting code but 1 adjustment every year is not the end of the world. The original idea consisted of this general idea (psuedocode):

if(11 Mar 2012 < date < 04 Nov 2012){
CountryCode = CountryCodeDST}
else{
CountryCode = CountryCode}

Here are the arrays with the function. Any ideas? Guidance? This is my first exposure to javascript and hopefully this question makes sense and can help others along with myself.

var CountryCode = new Array(
"CST",
"EST",
"MST",
"MST-Arizona");

var UTCoffset = new Array(
"GMT+0600", 
"GMT+0500",
"GMT+0700", 
"GMT+0700");

var CountryCodeDST = new Array(
"CST",
"EST",
"MST",
"MST-Arizona");

var UTCoffsetDST = new Array(
"GMT+0500", 
"GMT+0400",
"GMT+0600", 
"GMT+0700");

function TZ_Populate(dropdownField)
{
for (var i=0; i < CountryCode.length; i++)
dropdownField.addItem(CountryCode[i]);
}

function TZ_ReadOut(TZ_Alias, UTC_Alias)
{
for (var i = 0; i < CountryCode.length; i++)            
{
if (CountryCode[i] == TZ_Alias)                     
    {
    UTC_Alias.rawValue = UTCoffset[i];                  
    break;                                      
    }
}
}
  • 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-07T15:55:28+00:00Added an answer on June 7, 2026 at 3:55 pm
    if(11 Mar 2012 < date < 04 Nov 2012){
    CountryCode = CountryCodeDST}
    else{
    CountryCode = CountryCode}
    

    This is actually really easy in Javascript, because behind the scenes Javascript represents dates as integers (specifically the number of milliseconds since the epoch point). As a result, you can write almost literally the same code you had, and have it actually work:

    var Mar11_2012 = new Date('3/11/2012');
    var Nov04_2012 = new Date('11/4/2012')
    if(Mar11_2012 < date && date < Nov04_2012){
    CountryCode = CountryCodeDST}
    else{
    CountryCode = CountryCode}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My goal is to create an entry form (addnew.php) that will allow me to
My goal is to create a version of the app that will expire after
My goal is to create a list from menu.bin. This is the func: pitem
My goal is to create a vector of POSIXct time stamps given a start,
My goal is to create a reusable Attached Behavior for a FlowDocumentScrollViewer, so that
My goal is to create a website for a client that needs the site
I like to create a PDF which when printed out includes the date and
I need to create a file that will be used to store confidential data;
Goal: I want to get the text from the selected element and then create
My goal is to create a single object in powershell that shows the AD

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.