All Questions
Tagged with formatting datetime
436 questions
0
votes
1
answer
46
views
Rendering datetime and proper formatting
I have a Django project to keep track of tasks in an office environment. I have this model for tasks, and it has a finish_date attribute that is assigned as soon as I access the route to do the ...
-1
votes
1
answer
69
views
How to make a bar chart for sales data in csv file [closed]
I'm trying to make a bar chart of customer sales value by date.
I have imported the CSV but I'm stuck on formatting the date.
In the file, each date reads like this: 01.08.2023 00:37.
Each date has ...
0
votes
2
answers
63
views
I can't convert 46809654.36 into a date and time value in Google Sheets
I used the formula:
= ArrayFormula(SUM(min(A2:A1294)*(U2:U1294="")))
The A column contains timestamps,
and I got the result "46809654.36".
I want to convert this to a format like &...
27
votes
2
answers
2k
views
Why is the month abbreviated differently when the date format includes a slot for days as opposed to when it doesn’t?
When running a .NET 8 console application, why does MMM show "June" instead of "Jun" when its part of a date format (e.g. .ToString("dd-MMM-yy")) but "Jun" (e.g....
-1
votes
1
answer
159
views
Format path with date placeholders
Is there a way to insert date parts into a path containing date formats? I've got an application that should save files into yearly & monthly folders, but I'd rather not hardcode it.
The current ...
1
vote
0
answers
101
views
How to use data attribute to format a DateTimeOffset property in C#?
I have a C# class which is used as a API json response. I have some properties defined as DateTimeOffset.
public DateTimeOffset Time1 { get; set; }
public DateTimeOffset Time2 { get; set; }
The ...
13
votes
2
answers
4k
views
Java 21 problem with DateFormat.getDateTimeInstance().format(new Date())
This is my code
import java.util.Date;
import java.text.DateFormat;
class DateTime {
public static void main(String[] args) {
String dt = DateFormat.getDateTimeInstance().format(new Date()...
0
votes
3
answers
92
views
datetime and formatting - python
i am trying to print out the current hours mins seconds and milliseconds to a file accurately but cant seem to find the right formatting for the date format
log_file.write(datetime.datetime.strptime(f&...
0
votes
2
answers
329
views
Converting numeric variable to Stata Date format
The code below converts the numeric monthly observations into date format,
input month
1
2
3
4
5
6
7
8
9
10
11
12
end
clonevar monthname = month
format monthname %tmMonth
However, instead of 1 = ...
1
vote
1
answer
107
views
How to format different data types to a dd/mm/yyyy format in Python
I have an code that I want to change all the date column to a format of dd/mm/yyyy.
All the values passed in the date column are already in this kind of format, even the second value: 01/02/2001, ...
1
vote
4
answers
3k
views
How to format duration as XX hours and YY minute(s)
I have a given duration in minutes, e.g. 100 minutes, 140 minutes.
I need to display them in "XX hours and YY minute(s)" format.
e.g.:
1 minutes -> 1 minute
100 minutes -> 1 hour and ...
0
votes
0
answers
25
views
How to format the string values without space to datetime in python? [duplicate]
i have a pandas df:
Date
0
20221101
1
20220510
2
20230102
The dates are string and are formatted as %Y%M%D
I want to format the entire column to %D%M%Y. Like this:
Date
0
01-11-2022
1
10-05-2022
2
02-...
1
vote
2
answers
38
views
Save the date of today in a string
I want to save the date of today in a string and have the following code with the following output:
Code:
#include <stdio.h>
#include <time.h>
int main()
{
time_t t = time(NULL);
...
0
votes
1
answer
99
views
Why is there a difference in formatting a DateTime depending on the incoming DateTime-Format?
I have code which parses a DateTime and formats it like this:
DateTime.Parse(DateTimeValueXY, CultureInfo.InvariantCulture).ToString("dd/MM/yyyy hh:mm:ss tt")
In one case I get the error
...
1
vote
2
answers
499
views
How to convert user input date format to a different format on output in Python
I have a code where the date is an input converted to a date:
InvDateStr = input("Enter the invoice date (YYYY-MM-DD): ")
InvDate = datetime.datetime.strptime(InvDateStr, "%Y-%m-%d"...