PreparedStatement and setTimestamp in oracle jdbc

To set a timestamp value in a PreparedStatement in UTC timezone one should use stmt.setTimestamp(1, t, Calendar.getInstance(TimeZone.getTimeZone(“UTC”))) The Timestamp value is always UTC, but not always the jdbc driver can automatically sent it correctly to the server. The third, Calendar, parameter helps the driver to correctly prepare the value for the server.

DateTime precision in NHibernate and support for DateTime2 in NHibernate SchemeExport

Actually the NHibernate reference states that the DateTime nhibernate type will store the .NET DateTime as an SQL datetime truncated at the second level (no millisecond granularity) As such it provides the Timestamp NHibernate type (type=”Timestamp” in the mapping) which will store a .NET DateTime as an SQL datetime without truncation. Note here that an … Read more

Setting creation or change timestamps

For ext2/3 and possibly for ext4 you can do this with debugfs tool, assuming you want to change the ctime of file /tmp/foo which resides in disk /dev/sda1 we want to set ctime to 201001010101 which means 01 January 2010, time 01:01: Warning: Disk must be unmounted before this operation # Update ctime debugfs -w … Read more

now() default values are all showing same timestamp

That is expected and documented behaviour: From the manual: Since these functions return the start time of the current transaction, their values do not change during the transaction. This is considered a feature: the intent is to allow a single transaction to have a consistent notion of the “current” time, so that multiple modifications within … Read more

Python: reduce precision pandas timestamp dataframe

You could convert the underlying datetime64[ns] values to datetime64[s] values using astype: In [11]: df[‘Time’] = df[‘Time’].astype(‘datetime64[s]’) In [12]: df Out[12]: Record_ID Time 0 94704 2014-03-10 07:19:19 1 94705 2014-03-10 07:21:44 2 94706 2014-03-10 07:21:45 3 94707 2014-03-10 07:21:54 4 94708 2014-03-10 07:21:55 Note that since Pandas Series and DataFrames store all datetime values as … Read more