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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:58:31+00:00 2026-06-05T03:58:31+00:00

VBScript represents dates internally as a double, days since year 0 in the part

  • 0

VBScript represents dates internally as a double, days since “year 0” in the part to the left of the decimal point and the milliseconds since midnight for the current day to the right of the decimal. “Year 0” seems to be 1899 if

WScript.Echo Year(CDate(0))

can be trusted.

JScript on the other hand starts with a “year 0” of 1970 and represents time as the total milliseconds from then until now.

Can someone point me to code that makes possible conversion of JScript dates to VBScript dates and back again along these lines, of using the underlying Double or Long format of the date?

  • 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-05T03:58:32+00:00Added an answer on June 5, 2026 at 3:58 am

    Generate date using timestamp and convert into double.

    Function CurrentTZOffset()
        With CreateObject("WScript.Shell") 
            CurrentTZOffset = - .RegRead( _ 
            "HKLM\System\CurrentControlSet\Control\TimeZoneInformation\ActiveTimeBias")
        End With
    End Function
    
    Dim dblVbEpoch
        dblVbEpoch = CDbl(DateAdd("s", 1336708766790 / 1000, #1970/1/1#))
    
    WScript.Echo "VB Epoch :", dblVbEpoch
    WScript.Echo "VB Date (GMT):", CDate(dblVbEpoch)
    WScript.Echo "VB Date (LOCAL):", DateAdd("n", CurrentTZOffset(), CDate(dblVbEpoch))
    WScript.Echo "JS Epoch From VB Epoch:", DateDiff("s", #1970/1/1#, CDate(dblVbEpoch)) * 1000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since VBScript doesn't support lookbehinds, I'm looking for an alternative solution. I have the
I am running a VBScript as a Custom Action at the Commit part of
Consider the following VBScript which, when run, lists all the files in the current
Using Vbscript , we are getting current user email id. It is as simple
In vbscript, how do I run a batch file or command, in the current
VBScript on ASP Classic contains an int function. (It rounds numbers towards -∞.) Suppose
Vbscript always appears in my message box titles. How do I supress it in
I have a VBScript COM Component where I'm using Msxml2.FreeThreadedDOMDocument.4.0 however is there /
In asp classic and vbscript, you can declare a Const with a hexidecial value,
Ok I have a vbscript string in a wsf file as below: Dim strTransData

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.