I'm working on a project where I have to gather data from GPS devices located in different countries (timezones + daylight savings) and display those data to different users also from different countries. I'm thinking about saving the date in UTC format (that is what I receive from the GPS device) but then again I belive I'll have trouble converting that date to the user's local date (I have to display historical data also so I'll have to account for daylight savings for the given date). Maybe the datetimeoffset datatype would be more appropriate but how would I go about converting the received UTC date to the datetimeoffset datatype? What would you suggest? Thanks!
Which SQL datatype should I use to store datetime from GPS devices?
399 Views Asked by sdagkas At
1
There are 1 best solutions below
Related Questions in SQL
- Can MVC.NET prevent SQL-injection at razor or controller level?
- SQL server not returning all rows
- When dealing with databases, does adding a different table when we can use a simple hash a good thing?
- Creating a parametrized field name for a SELECT clause
- Combine two rows based on common ID
- Column displays each count
- Slick query for one to optional one (zero or one) relationship
- Aggregate and count in PostgreSQL
- MAX and GROUP BY - SQL
- SQL statement for a tricky 2 table query
- How to create nested selects with sql?
- Pull and push data from and into sql databases using Excel VBA without pasting the data in Excel sheets
- Best Practice for adding columns to a Table in Oracle database
- SQL FIFO STACK using two tables
- SQL Query - Order by String (which contains number and chars)
Related Questions in GPS
- identify GPS mobile phonegap
- Android runtime permissions on android versions below M?
- iOS Distance between two GPS Location
- GPS not showing current location on map
- java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setTextColor(int)' on a null object reference
- using Gps Getting Latitude and Longitude
- Position marker in Google Map is not disapearing when position is lost
- How to set/get GPS Accuracy on Android Emulator?
- GPSTracker Class not working
- How to Switch ON and OFF GPS
- GPS App compile errors
- OpenGTS platform
- FusedLocationProviderApi Fatal exception: GoogleApiClient is not connected yet.
- SQL LINESTRING() versus multiple rows
- Trouble connecting to gpsd
Related Questions in UTC
- Time not getting converted to local time properly via moment.js
- What is a good practice when we need to work with datetime
- java.time in Scala - Getting UTC offset from Time Zone
- JavaScript getTimezoneOffset() method in Golang
- Convert date from yyyy-mm-dd to utc format
- Globalizing date & time format in MVC
- need to convert UTC time to current timezone of device
- How does the (Oracle) Java JVM know a leap second is occurring?
- UTC seconds and time format expression convertion in Python
- Why the results of the command 'date -u' command 'date' faster than the result of 25 seconds in linux(centos 5.1)?
- Solr 4.5 not saving time correctly
- PHP Timezone incorrect When using time()
- Calling a function on UTC time
- Index 11 from Calendar prints months in string as "January"
- Convert server time zone to local time zone in Crystal Reports
Related Questions in DATETIMEOFFSET
- DateTimeOffset parse and custom time zone
- How to build custom pandas.tseries.offsets class?
- Get right datetime format from SQL reader
- DateTimeOffset Same Day comparison
- How do I parse ISO 8601 date without year using DateTimeOffset?
- What does dashes mean in ISO 8601 date and time format?
- Convert Time zonoffset value to varchar
- How to properly work with Timezone?
- Convert OffsetDateTimeUdt to date or string
- How can I convert a Sql Server 2008 DateTimeOffset to a DateTime
- Python: third Friday of a month
- Why is this iso8601 date parsing with an offset of +2?
- How to get DateTime with a UTC datetime and a particular timezone?
- Best practice for DateTime <--> DateTimeOffset
- Can I use the DateTimePart function against a DateTimeOffset serialized object in Azure Cosmos?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
As you don't have to store any time zone along with the datetime, you can store them as UTC. That has the advantage of being linear, and easy to document. You don't have to bother with gaps and overlaps at the daylight savings time switches.
Convert the date to the local time zone when you display it to the user. It doesn't make sense to convert it to a local time zone until you know which user will be viewing the data.