GithubHelp home page GithubHelp logo

Date and time zone about node-firebird HOT 3 CLOSED

hgourvest avatar hgourvest commented on June 10, 2024
Date and time zone

from node-firebird.

Comments (3)

xdenser avatar xdenser commented on June 10, 2024

That better illustrates problem

 var con =  new fb.Database('127.0.0.1', 3050, cfg.db, cfg.user, cfg.password,function(){
     con.execute("select TIMESTAMP 'now' from rdb$database", function(rs){
          console.log(rs.data[0][0]);
          console.log(new Date());
     });    
 });

outputs:

[xdenser@localhost node-firebird]# node date-issue.js
Sat, 09 Jun 2012 01:32:23 GMT
Fri, 08 Jun 2012 22:32:23 GMT

from node-firebird.

JohannesHoffmann avatar JohannesHoffmann commented on June 10, 2024

This issue is not working in my case.
Problem:
A select with a date field outputs:

Date in Firebird: 2018-08-26
Output in node: 2018-08-25T22:00:00.000Z

My server has a timezone Berlin with UTC DST offset from +120 minutes.
The output of d.getTimezoneOffset(); says -120.
Changing the plus to minus solved the problem, see:
d.setMilliseconds((ret - DateOffset) * TimeCoeff - d.getTimezoneOffset() * MsPerMinute)

This is my first problem encountered with timezones so i have no idea why this is a problem?

from node-firebird.

roelandmoors avatar roelandmoors commented on June 10, 2024

I think that fix should be optional. It depends on how you save the date in your database. With current timezone or without it (UTC).

from node-firebird.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.