Jump to content

AlexElb

Members
  • Posts

    1
  • Joined

  • Last visited

LabVIEW Information

  • Version
    LabVIEW NXG
  • Since
    2017

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

AlexElb's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In Rare

Recent Badges

0

Reputation

  1. Hey there, first of all, this is my first post on lavag. I've already learned a lot here and would like to say hello and thank you all for all the information and great toolkits on lavag. I am just playing around with sqlite for two days after I watched this and that video. Very impressive. I have a questions about using timestamps. I would like to store timestamps in UTC but display them in LV in the different users timezones. Please excuse my question for its triviality and probably its more a general problem than a LV one. I hope it is okay to ask it here. My insights until now: using "Bind Timestamp(Real) you simple use "to dbl", so it will need only 8 bytes: minimal storage used, but still 3 decimal places - perfect. LabVIEW stores the time in UTC format, but displays the time in Local Time format (link). It can be converted manually in LV.7 If the timestamp was stored as a DBL, "to timestamp" is used. The more the database can do, the less I have to do in LV Until here everything looks okay, but then I got confused: According to https://www.sqlite.org/datatype3.html sqlite will store it as a REAL as Julian day numbers. How can the LV UTC format starting 01-01-1904 00:00:00 work together with the Julian day format? I tried the following and insert a standard lv current timestamt to the second colum. DROP TABLE IF EXISTS times; CREATE TABLE times( dbtimeutc REAL, lvcurrenttime REAL); CREATE TRIGGER IF NOT EXISTS insert_Timer AFTER INSERT ON times -- Julian REAL format BEGIN UPDATE times SET dbtimeutc = julianday('now') WHERE rowid = new.rowid; END; After a select, first column shows me a date in 1904, second is correct. I try to ask it easy: What do I have to do for storing a UTC Datetime as a REAL (as Julian Day) using LVs Get Datetime In Seconds Funtion? Or is there not any extra work needed? What do I have to do for reading that value out to LV in UTC, in Local Time, or any other timezone? It should be possible in sqlite without havin to convert it manually in LV, shouldn't it? How to create such a timestamp in sqlite? Because of course I want all timestamps in my database to be in the same format. How to view that value as a human readable Datestring within SQLite Expert Personal? (only nice to have) Thanks in advance for any hints.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.