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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:03:47+00:00 2026-06-15T04:03:47+00:00

I am trying to convert column with GMT hour to the specified time zones

  • 0

I am trying to convert column with GMT hour to the specified time zones from the user.

I get an error when VBA attempts to subtract 18000 secs (GMT-5) from 01:00.

Selected_GMT = -18000
CellValue = "1/0/00 01:00"

New_Time = DateAdd("s", Selected_GMT,CellValue)

Is this error happening because VBA is unable to determine the hours before 00:00?
I have figured out the seconds for Selected_GMT, how can I use that to determine New_Time?

  • 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-15T04:03:49+00:00Added an answer on June 15, 2026 at 4:03 am

    As ooo noted in a comment above, 1/0/00 is an invalid date code. However even if that was a typo in your question, the fact that the date uses a 2 digit year code begs the question “WHICH year 00?” Apologies if you already know this, but below I’ve extracted a recap of how Excel dates work from something that I’ve written elsewhere. The relevant part is “Day Zero And Before In Excel”; if the “00” actually represents *19*00 in the cell (as it will if you’ve just punched in “01:00 as the cell entry), you’re going to run into problems subtracting from that. In which case, perhaps explicitly enter the date and time (perhaps using the current date) but hide the date component using formatting):

    Excel uses a “date serial” system in which any date that you use in
    calculations is represented as a positive integer value. That integer
    value is calculated from an arbitrary starting date. Adding whole
    numbers to a specific serial date moves you forward through the
    calendar a day at a time, and subtracting whole numbers moves you
    backwards… as long as you don’t go past the starting date of the
    serial number system and end up with a negative value. Times are
    represented as fractions of a day; 0.25 for 6am, 0.5 for noon, 0.75
    for 6pm and so on.

    Excel Dates

    In the case of Excel for Windows, the starting date is 1 January 1900. That is, if you enter the value 1 into a cell in Excel
    and format it as a date, you’ll see the value as 1 January 1900. 2
    will be the 2nd of January 1900, 3 the 3rd of January, and so on. 367
    represents 1 January 1901 because Excel treats 1900 as having been a
    leap year with 366 days. In other words, every full day that passes
    adds 1 to the serial date.

    It’s important to remember that the above relates to Excel only, and
    not to Access, SQL Server or other database products (or Visual Basic,
    for that matter). In Access, for example, the range of valid dates is
    1 January 100 to 31 December 9999, the same range that can be stored
    in a VB or VBA variable with a Date data type.

    Excel And The Macintosh

    Macintosh systems use a start date of 1 January 1904, neatly bypassing the 1900 leap year issue. However that
    does mean that there’s a 4 year discrepancy between the serial date
    values in a workbook created in Excel for Windows, and one created in
    Excel for the Mac. Fortunately under Tools -> Options-> Calculation
    (on pre-2007 versions of Excel) you’ll find a workbook option called
    1904 Date System. If that’s checked, Excel knows that the workbook
    came from a Macintosh and will adjust its date calculations
    accordingly.

    Excel Times

    As noted in the introduction, times are calculated as a
    fraction of a day. For example 1.5 represents noon on 2 January 1900.
    1.75 represents 6pm on 2 January 1900.

    (Snipped a bit about the leap year bug in 1900)

    From 1 March 1900 onward Excel’s dates are correct, but if you format
    the number 1 using the format dddd, mmmm dd, yyyy you’ll get the
    result Sunday, 1 January 1900. That is incorrect; 1 January 1900 was a
    Monday, not a Sunday. This day of week error continues until you reach
    1 March, which is the first truly correct date in the Excel calendar.

    Day Zero And Before In Excel

    If you use the value zero and display it
    in date format you’ll get the nonsense date Saturday 0 January 1900.
    If you try to format a negative value as a date, you’ll just get a
    cell full of hash marks. Similarly if you try to obtain a date serial
    number using Excel functions like DateValue, you can only do so for
    dates on or after 1 January 1900. An attempt to specify an earlier
    date will result in an error.

    The 1904 (Macintosh) system starts from zero. (1 January 1904 has a
    value of 0, not 1. Excel’s on-line help describes the Mac system as
    starting from January 2, but that’s probably easier than explaining to
    users why a serial date value of 0 works on the Mac but not Excel.)
    Negative numbers won’t generate an error, but the number will be
    treated as absolute. That is, both 1 and -1 will be treated as 2
    January 1904.

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

Sidebar

Related Questions

Trying to convert output from a rest_client GET to the characters that are represented
I'm trying to convert a column from ntext to nvarchar(MAX), but it seems there
I'm trying to convert a varchar(50) column to a uniqueidentifier, but this error keeps
I'm trying to convert ColdFusion query column to a list, what is the best
I am trying to convert a value from a datetime field in a MySQL
I'm trying to convert from excel spreadsheet (.xls) to html via MS Excel 2010,
I have spent a great deal of time trying to convert the query below
Group, I am sure this is user error somehow, but I am trying to
I am trying to convert a character column to numeric and I have tried
I'm trying to get a list of dates from my table, which contains a

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.