Tags » Datetime

Python display milliseconds in formatted string using `time.strftime`

I am trying to format milliseconds to formatted string preserving the milliseconds part. Here’s my code:

import time

time.strftime('%Y-%m-%d %H:%M:%S:%f', time.gmtime(1515694048121/1000.0))

where 1515694048121 is a time in milliseconds… 393 more words


Numpy isnat() returns value error on datetime objects

Have been working through options listed in Converting between datetime, Timestamp and datetime64; however, numpy’s isnat() seems to not recognize a datetime object, or I’m missing some other kind of datetime object that the function requires for input. 363 more words


Moving from Datetime to Datetime2

On our project, I have started implementing a small design change; we will be phasing out the use of the DATETIME datatype and begin using DATETIME2 instead.  250 more words

T-SQL Coding

How to add and subtract from current time in C#

Working with date-time fields can be confusing. How do you add or subtract time?  It is actually quite easy.  When you have a date-time field you can use the dot add method. 39 more words


How to Avoid SharePoint Time Zone difference Error when working with DateTime fields in CSOM ?

When working with SharePoint CSOM I come across a strange thing when the server and local user time zone are different.

I had entered date 12/11/2015 but when I was checking in the code at runtime the DateTime field DueDate returns 11/11/2015. 94 more words


Interesting observation with DATETIMEOFFSET data type in SQL

Calculating daily max values of a table will be different if you are using/storing the data in DATETIMEOFFSET format.

Basic difference is, while comparing the data between DATETIMEOFFSET and DATE (or DATETIME), DATETIMEOFFSET value will be converted to UTC and compared. 199 more words


Types of Variable in Python and Typecasting

Python has many types of variables. Some key ones are-

  • Integer (Whole number)
  • Float (Decimal points)
  • String (Categorical)
  • Date time

It’s easy to convert one type of variable into another type, whenever possible. 33 more words

Data Science