Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [datetime]

A DateTime object in many programming languages describes a date and a time of day. It can express either an instant in time or a position on a calendar, depending on the context in which it is used and the specific implementation. This tag can be used for all date and time related issues.

0 votes
3 answers
16 views

Find out number of days in a given quarter when date is provided? [duplicate]

I have a data frame with a large number of dates (more than 25 million rows). The sample data looks like this df <- data.frame(dat = as.Date(c('2015-10-10', '2016-04-04', '2016-01-31', '2017-04-16')...
7 votes
4 answers
19k views

Convert ticks to unix timestamp

I m getting start time 634942626000000000 and end time 634942638000000000. How can I convert it to a Unix timestamp? I want to display formatted date/time in PHP?
0 votes
2 answers
32 views

Find average temperature from a range of datetime for each day in dataframe

This is a subset of the dataframe I have: structure(list(name = c("waldorf", "waldorf", "waldorf", "waldorf", "waldorf", "waldorf", "...
0 votes
2 answers
482 views

Java get FirstDate and LastDate of following month in MM/dd/yyyy format even if the input is not the first day of the month

I have a function below which has an input Date and it will return the first and last Date of the next month in MM/dd/yyyy format. String string = "01/01/2022"; DateFormat sdf = new ...
0 votes
0 answers
24 views

Pandas check if a column has NaT type, unable to find date diff with NaT values [duplicate]

I have StartDate and ExitDate two columns in my dataframe with NaT values in ExitDate column I wish to create a third column Tenure by finding Difference between ExitDate and StartDate. StartDate ...
2 votes
1 answer
136 views

Why is C# DateTime.Now/DateTime.UtcNow ahead of SQL Server's SYSUTCDATETIME()/SYSDATETIME() even though C# code executes before the SQL Query

I want to know the reason why my C# date is larger than the SQL date even though the C# code is running first and after that the SQL query, Logically the SQL date should be greater than C# date. For ...
101 votes
14 answers
181k views

datetime: Round/trim number of digits in microseconds

Currently I am logging stuff and I am using my own formatter with a custom formatTime(): def formatTime(self, _record, _datefmt): t = datetime.datetime.now() return t.strftime('%Y-%m-%d %H:%M:...
0 votes
1 answer
56 views

Query between two dates gives incorrect results in SQL Server? [closed]

Im trying: SELECT * FROM database a WHERE Applicant_End_date >= '2024-01-01' AND Applicant_Start_date <= '2024-06-30'; Results: Applicant_End_date shows results starting at 2024-01-01 like: ...
268 votes
5 answers
268k views

Print all day-dates between two dates [duplicate]

For example: from datetime import date d1 = date(2008,8,15) d2 = date(2008,9,15) I'm looking for simple code to print all dates in-between: 2008,8,15 2008,8,16 2008,8,17 ... 2008,9,14 ...
-1 votes
0 answers
21 views

php8.1 - Deprecated code involving date_create() [duplicate]

Here are the errors I am getting: Warning : Undefined variable $modified in /home/cssdar/public_html/members/templates/cassiopeia_members2024/index.php on line 38 Warning : Undefined variable $...
10 votes
5 answers
36k views

Time difference and convert into hours and minutes in javascript

I am having the time values as follows starttime like : 09:00:00 , endTime like : 10:00:00 ; here no date value is needed. so this values need to calculate difference and convert into hours and ...
-1 votes
3 answers
52 views

Laravel Carbon (How to calculate exit next payment date)

I need to get exit next date of payment of loan: as loan date: 1-1-2020 loan period: 2 years 5 months payment date: ? ? calculating expected date of payment // calculating next payment date ...
0 votes
4 answers
1k views

Convert a tuple into Datetime

Kindly need some help please :) I have two date-time's i am using the date-time.combine to concatenate one is datetime.date (pretty much todays date) - the other is datetime.time (which is a ...
0 votes
1 answer
19 views

How do I add 'week of year' and 'day of year' columns to a python datatable?

There is currently (version 1.1.0) no python datatable.time.week() or datatable.time.day_of_year() functions. Here is some example data: from datetime import date import datatable as dt DT = dt.Frame(...
2 votes
1 answer
41 views

how do you sort column names in Date in descending order in pandas

I have this DataFrame: Node Interface Speed Band_In carrier Date Server1 wan1 100 80 ATT 2024-05-09 Server1 wan1 100 50 ...

15 30 50 per page
1
2 3 4 5
4751