Category "datetime"

Get actual time from internet ?

How to get 'current(actual) time' or 'network operator's time' programmatically if device time is changed ? I'm trying to get current time through 'getLastKnow

Get DataFrame with the number of rows for each time interval

Given the following DataFrame of pandas in Python: | ID | date | |--------------|------------------------------------

how to manage the timezone which are not directly supported in java

we are getting the ZoneId object by passing the id string -> ZoneId.of("US/Alaska") While getting the timezone ids from java after passing the location name,

Get file modification time to nanosecond precision

I need to get the full nanosecond-precision modified timestamp for each file in a Python 2 program that walks the filesystem tree. I want to do this in Python i

Correctly determine if date string is a valid date in that format

I'm receiving a date string from an API, and it is formatted as yyyy-mm-dd. I am currently using a regex to validate the string format, which works ok, but I c

Not able to see all the methods under dt accessor in Jupyter notebook

Maybe a silly question. I have been trying to use dt accessor in pandas to use datetime methods on certain date fields in my Data Frame. Not sure why, but the a

Matplotlib and datetime error date2num function AttributeError

I'm trying to plot a graph with a list of datetime objects as one axis. I searched online and it seems I should call the date2num function. However, when I call

How to convert time from one timezone to another in PHP

I have a code see below. The time zone for the time 16:17 is Europe/Vilnius. My goal is to apply time zone $tz2 = 'Africa/Dakar' and get 16:17 time in Africa/Da

Date to String format in Firebird

How can I customize CAST (TimeStamp TO STRING) format in Firebird? cast (<DateField> as VarChar(25)) It does not work as I want. I do as I wish with t

How to check if a DateTime value is not null or empty?

I want to check if the DateTime field is not an empty\null string. if datetime field is not null then I will do stuff. [DateTime]$expdate = Read-Host "Expirati

Getting today's date in YYYY-MM-DD in Python?

Is there a nicer way than the following to return today's date in the YYYY-MM-DD format? str(datetime.datetime.today()).split()[0]

How to cast a datetime format to date as string in SQL Server

I am struggling to find a solution for the below issue. date1 = 31-08-2017 12:10:00 I want to cast it as string and need to take date (31-08-2017) alone. Th

What should I use instead of the deprecated Date.getHours()

If a method is deprecated in Java there will be a another better way to have same functionality, right? Date date = new Date(); date.getHours() As getHours()

Possible bug with getTransitions in PHP 8.1?

I know a lot of date-related bugs have been fixed in PHP 8.1, but it may have introduced new ones... Take this code: $time_zone_id = 'America/Vancouver'; $timeZ

How to change the datetime tick label frequency for matplotlib plots

Below shows a plot of simulated data, which contains the xticks that I want to modify. By default, the pd.df.plot chooses dates that are approximately 3 months

Laravel Carbon throws error The format separator does not match

I'm, trying to format a date into (Dayname Date Month) and I'm using Carbon for this but it return an error Carbon The format separator does not match here is a

Get current quarter in year with javascript

How can I get the current quarter we are in with javascript? I am trying to detect what quarter we are currently in, e.g. 2. EDIT And how can I count the numbe

How to get python to display current time (eastern)

How can I get Python to display the time in eastern? I've looked over the python documentation but it's pretty confusing. I'm using Python 3.

Adding two DateTime objects together

Is there any better way to add one DateTime object to another one, than this: DateTime first = new DateTime(2000, 1, 1); DateTime second = new DateTime(11, 2,

NameError: name 'UTC' is not defined

The output of datetime.datetime.now() outputs in my native timezone of UTC-8. I'd like to convert that to an appropriate timestamp with a tzinfo of UTC. from d