strftime Questions
3
Solved
I have the following Time object:
[8] pry(#<#<Class:0x007f928f12f560>>)> display_num
=> 2015-02-19 09:00:00 -0600
[9] pry(#<#<Class:0x007f928f12f560>>)> display_nu...
Antimonyl asked 2/2, 2015 at 22:12
3
I was looking at the format specifiers and noticed that %n and %t were listed as valid specifiers. According to the documentation, the insert a new line and a horizontal tab character, respectively...
2
Solved
I have a polars dataframe that contains a datetime column. I want to convert this column to strings in the format %Y%m. For example, all dates in January 2024 should be converted to "202401&qu...
Codeclination asked 6/8 at 21:9
5
Solved
I have a datetime that is a string I read from a text file. I want to trim the extra milliseconds off of it, but I want to convert it to a datetime variable first. This is because it may be in diff...
5
Solved
Every time I use:
time.strftime("%z")
I get:
Eastern Daylight Time
However, I would like the UTC offset in the form +HHMM or -HHMM. I have even tried:
time.strftime("%Z")
Which still yield...
20
I have a string representing a unix timestamp (i.e. "1284101485") in Python, and I'd like to convert it to a readable date. When I use time.strftime, I get a TypeError:
>>>import...
Manganous asked 10/9, 2010 at 6:56
9
Solved
My dataframe has a DOB column (example format 1/1/2016) which by default gets converted to Pandas dtype 'object'.
Converting this to date format with df['DOB'] = pd.to_datetime(df['DOB']), the date...
22
When using Python strftime, is there a way to remove the first 0 of the date if it's before the 10th, ie. so 01 is 1? Can't find a %thingy for that?
Thanks!
18
Solved
I tried using $(date) in my bash shell script, however, I want the date in YYYY-MM-DD format.
How do I get this?
Crenshaw asked 9/9, 2009 at 19:6
3
Solved
I have a simple SQL for calculating week number in my reports on SQLite
SELECT STRFTIME('%W', 'date_column')
It was correct for 2009-2012. In 2013 I got always the wrong week number.
For exampl...
Huoh asked 26/2, 2013 at 6:14
2
Solved
I'm trying to convert string timestamps to polars datetime from the timestamps my camera puts in it RAW file metadata, but polars throws this error when I have timestamps from both summer time and ...
Orling asked 4/1, 2023 at 10:7
10
Solved
6
Solved
i'm trying to format the date like this,
2015-12-02T12:57:17+00:00
here's my code
time.strftime("%Y-%m-%dT%H:%M:%S%z", time.gmtime())
which gives this result,
2015-12-02T12:57:17+0000
i can'...
2
Solved
C++ defines time formatting functions in terms of strftime, which requires a struct tm "broken-down time" record. However, the C and C++03 languages provide no thread-safe way to obtain such a reco...
3
I'm trying to create AWK script that will filter the input file according to some pattern, and use the strftime() function for some calculations.
($2 ~ /^[HB]/ && $2 ~ /n$/){
print strfti...
3
Solved
An API returns a timestamp as UNIX timestamp at UTC and I would like to know if this timestamp was more than x seconds ago. As expected, this works fine with os.time() - x > timestamp in UTC, bu...
2
Solved
Parsing a date string using datetime.strptime such as:
from datetime import datetime
datetime.strptime('AUG21 3:26PM', '%b%d %I:%M%p')
Results in
1900-08-21 15:26:00
How can I write something si...
5
Solved
I am getting the error
undefined method `strftime' for "2013-03-06":String
when trying to display a date normally (June Sunday 3, 2013 or something similar) from the string 2013-03-06 using strf...
Patrizius asked 31/3, 2013 at 23:5
7
Solved
I am getting the lovely � box where spanish characters should be displayed. (ie: ñ, á, etc). I have already made sure that my meta http-equiv is set to utf-8:
<meta http-equiv="Content-Type" co...
Kent asked 1/2, 2013 at 15:26
8
Solved
I'm working on a site and my customer is from Russia. He said that the month translation in the news is wrong.
For example, September:
I get this from php: Сентябрь
and this from him: Сентября
...
3
I have $date = $run['at']; which gives me 2013-06-03T16:52:24Z (from a JSON input).
To transform it to get for example "d M Y, H:i" I use
$date = new DateTime($run['at']);
echo $date->format('d...
Karns asked 3/6, 2013 at 22:33
8
Solved
I want to format a date object so that I can display strings such as "3rd July" or "1st October". I can't find an option in Date.strftime to generate the "rd" and "st". Any one know how to do this?...
2
I have a dataframe of information. I set the index to be the received date and time. Now I want a list
I set the df index doing this:
df.index = pd.to_datetime(df.index, format='%m/%d/%Y %H:%M'...
1
Solved
I'm trying to auto mark the output file with timestamps with ffmpeg. Here's my test cmd:
.\ffmpeg.exe -y -loglevel 99 -i test.mp3 -strftime 1 %Y.ogg
I expected a file named 2020.ogg, however onl...
11
This is the code I use to get the date (in spanish):
$fecha = strftime("%d de %B, %Y, a las %l:%M %p");
and I get:
27 de julio, 2011, a las 7:10
So the question is, where is my PM (or AM)?
M...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.