When was oracle DB timezone last updated - database

Is there any way we can check when was the timezone setting change happened in oracle , like exact date and time ?

Related

Logstash exception while fetching incremental data from SQL Server

I am using LogStash 7.3.2 to fetch incremental data from SQL Server using this query:
select * from mytable where lastupdatetimestamp > :sql_last_value
I also have specified last_run_metadata_path in logstash config file.
It works fine but sometimes it is throwing an exception:-
Exception when executing JDBC query {:exception=>#
transition (daylight savings time 'gap'): 1942-09-01T00:00:00.000 (Asia/Kolkata)>}
Why am I getting this exception and due to this exception it does not save last timestamp value and again it fetches duplicate records from SQL Server.
Any help regarding this would be highly appreciated.
As stated here
In Logstash if a datetime string has no TZ part it is assumed to be a UTC time.
If you know that the datetime is a local time string then you need to tell the date filter which timezone the date was generated in. You may use one of the Joda timezones,
e.g. America/New_York, America/Detroit or EST5EDT - these are merely labels that point to Timezone Java code that know what changes in clocks occurred in all timezones for quite some time into the past.
See this page for info on how the updates are followed. http://www.oracle.com/technetwork/java/javase/tzdata-versions-138805.html 100
Once the datetime string is converted to a Timestamp object (by the date filter) it is considered UTC time.

SQL/Navision DateTime Issue

I don't know if anyone else has experiencing this issue before
I have DateTime Data in a MsSQl table but when displaying the same data in Navison 2013, it is displaying the time wrongly.
2018-12-14 08:20:22.000 is being displayed as 14-12-18 11:20:22 AM
Any suggestions ?
Thanks in Advance
The time stored in the SQL database will be stored in UTC. However, since you're based in Kenya (I assume from your profile), your time zone is UTC+3. Navision (Dynamics NAV) automatically converts UTC time into your local time zone.
So if you're writing to the database directly without going through Navision you should use UTC time to save the time.

How can I manage timezone differences between client and server in Silverlight?

I have SL 5 app with a form which has a field for Date.
I set the default date for this field in code like:
MyDate = System.DateTime.Today;
Or
MyDate = System.DateTime.Now.Date;
then submit the data with WCF Ria Service to save the data into database.
Problem is: if time zone on user client computer and Web server are different, the data of date would be saved with different value.
For example, today is Jan-03-2013, when I save the data from the form, in database, the data is saved as something like Jan-02-2013 23:00:00., not Jan-03-2013 00:00:00.
How to fix this problem?
you could try using
MyDate = DateTime.UtcNow
which would return utc time to the server then you can either store all datetimes as utc or manipulate it before saving to the the db (so it would be saved as server's local time)
In addition to timezone differences, there can be also real date value difference between client and server.
For that reason I think you should always get the date from server each time or you should ger the time at the application startup from both the client and server and find the the difference interval. Then you should calculate server datetime by adding the difference to the local date value.
For the timezone differences, also you should alway work in UTC format bu you should show the value to the user as local timezone format of course.

DateTime.Today value changed when sending to the server

I am working with Silverlight and I am getting a problem. In my Database I have stored some dates with a format like this yyyy/mm/dd 00:00:00, which means that I store only the year, month and day, getting the time to 00:00:00.
When the client performs an action and sends to the server I get the DateTime.Today which will keep the format of my database date, but when it is sendind I get yyyy/mm/dd 22:00:00, so when my server side function gets the date, it will return no values from the database.
How can I fix this to get the correct datetime?
Thank you
Use UTC times to make sure you don't run into timezone issues.
You can see if the DateTime is UTC or local based by checking the Kind property, and you can get the current UTC time by DateTime.UtcNow.
DateTime structure is very prone to DST, timezones and cultures when serialising it.
are you serialising it at client side before push it ? what is the difference between client and server timezones ?
I would suggest that you try and consume DateTime.UtcNow and then serialise the data. i prefer to serialise using Invariant culture
HTH
In addition to storing UTC time in the database, you can hard set the time to 12:00:00 for all date values by using the Date property of the DateTime class.
DateTime.UtcNow.Date
You can present the date to the user in their local timezone using the ToLocalTime method:
DateTime.ToLocalTime().Date
I'm sure every database engine has a similar function, but the SQL Server function to get UTC date is (surprisingly enough):
GETUTCDATE()
I hope this helps.

Data transfer between SQL Servers in different timezones

I transfer data from one SQL Server to another using SELECT * INTO .... statement (in Management Studio). Both databases have different timezone settings.
Is it possible to adjust all date/time fields to different timezone automatically? Maybe some query parameters or connection settings?
Since you are on SQL Server 2008, you could use the built-in functionality of the DATETIMEOFFSET datatype, and the SWITCHOFFSET function.
You could do something like:
INSERT INTO dbo.YourTargetTable( ...... )
SELECT
SWITCHOFFSET(TODATETIMEOFFSET(YourSourceTime, '+04:00'), '-09:00'),
.......
TODATETIMEOFFSET converts your "regular" date without any timezone information into a DATETIMEOFFSET type with a time zone (of your source location), and then you can apply a SWITCHOFFSET call to that value to "switch" your date/time to your target location's time zone.
This can be done in the scope of the INSERT....SELECT statement - no separate "row-by-row" updating necessary.
I think this will be helpful, please follow the link:
Effectively Converting dates between UTC and Local (ie. PST) time in SQL 2005
Shortly, you do need to build time zone and DST tables to get some help with time zones.
Thanks

Resources