Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » sqlite and dropdate / editdate etc (Can you receive an integer value and display as date?)
Re: sqlite and dropdate / editdate etc [message #54895 is a reply to message #54888] Sat, 26 September 2020 04:28 Go to previous messageGo to previous message
mr_ped is currently offline  mr_ped
Messages: 826
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
just a general note: I would rather store epoch seconds or some UTC timestamp than formatted date.
The particular formatting/timezone should be done when viewing the data and adjusted to current user locale/preference/options, but database should have the data itself. (that way if multiple users from different timezones are viewing the same datetime, each user sees their own familiar form of it)

Also with storing the formatted date (in general sense, if you store any kind of date) you may easily run into some peculiarities of certain dates and times (for example there's every now and then a day with 61 seconds in last minute, i.e. 23:59:60, etc), so having it in form of some timestamp supported by some common datetime library (or C++ native support, I think there's some date/time stuff added recently in C++17 or C++20? or was it already C++14?) is usually the safest way, how to avoid all of these complex things around time, and just use the library functions.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How does All_Tables determine if a table exists?
Next Topic: Program changing column
Goto Forum:
  


Current Time: Sun May 11 00:07:37 CEST 2025

Total time taken to generate the page: 0.03029 seconds