strftime Questions

2

Solved

I need to custom format dates. In ruby, I would use strftime, or string formatted time, to accomplish this. now = Time.new now.strftime '%a, %d of %b' #=> "Sat, 27 of Jun" Does javascript use...
Radicle asked 27/6, 2015 at 14:21

3

Solved

I am currently learning the zsh and now I wanted to use strftime but i get: zsh: command not found: strftime I think I'm doin' something wrong, since I see people using that function all the ...
Paronymous asked 18/4, 2010 at 11:56

8

Solved

I'm trying to use strftime() to microsecond precision, which seems possible using %f (as stated here). However when I try the following code: import time import strftime from time print strftime(...
Swill asked 13/7, 2011 at 10:15

6

Solved

I have a large data set with a variety of Date information in the following formats: DAYS since Jan 1, 1900 - ex: 41213 - I believe these are from Excel http://www.kirix.com/stratablog/jd-edwards...
Lurdan asked 11/1, 2013 at 4:41

2

Solved

awk can generate a timestamp with strftime function, e.g. $ awk 'BEGIN {print strftime("%Y/%m/%d %H:%M:%S")}' 2019/03/26 08:50:42 But I need a timestamp with fractional seconds, ideally down to ...
Deirdra asked 26/3, 2019 at 13:58

8

Solved

I have a time in UTC from which I want the number of seconds since epoch. I am using strftime to convert it to the number of seconds. Taking 1st April 2012 as an example. >>>datetime.dat...
Demonstrative asked 31/7, 2012 at 14:59

2

I store date field in the database as number of seconds since epoch: For the timestamp in the image (1550591783—representing 2019-02-19 19:26:23), sqlite should return 50 as day of the year but ...
Prestissimo asked 19/2, 2019 at 16:12

1

Solved

I want to construct YYYY_WW information from dates (where WW is a number of week). I am struggling with the years' endings (beginnings), where a part of a week can fall into the neighbouring year: ...
Simile asked 11/3, 2019 at 17:4

3

Solved

I am currently trying to code this in R. I would like to take a date that I have in %Y-%m-%d (ex: 2017-12-31) format and convert it to the day of the year. However, I would like it to always count ...
Trotter asked 1/3, 2019 at 14:13

2

What does 'strf' in 'strftime' stand for? I've googled this question numerous times, but haven't found an answer. Knowing what the letters stood for would enable me to more easily remember the name...
Biagio asked 27/4, 2018 at 15:53

5

I want a function that will take a time_t parameter and an arbitrary format string and format it. I want something like this: std::string GetTimeAsString(std::string formatString, time_t theTime) ...
Durwyn asked 28/10, 2011 at 22:22

12

Solved

Through profiling I've discovered that the sprintf here takes a long time. Is there a better performing alternative that still handles the leading zeros in the y/m/d h/m/s fields? SYSTEMTIME sysTi...
Department asked 7/11, 2008 at 12:51

1

Are there any standard (C, C++, POSIX, Linux...) alternatives to strftime which can be used to calculate the required size of the string buffer for a given format and time, truncate the output (i...
Griseous asked 6/7, 2017 at 10:37

2

Solved

I'm processing hundreds of thousands of dates in Python and noticing that the strftime function is pretty slow. I used timeit to check and it tells me that it takes roughly 0.004 which is fine for...
Raama asked 19/4, 2017 at 11:49

3

Solved

In my app I find myself using stftime a lot, and mostly with 2 strings formats - ("%d/%m/%Y") and ("%H:%M") Instead of writing the string each time, I want to store those strings in some global va...
Tymothy asked 18/1, 2017 at 9:33

2

Solved

Let's say that I want to print something simple like this table: January 1 February 2 March 3 April 4 May 5 June 6 July 7 August 8 September 9 October 10 November 11 December 12 I'd like to acco...
Aylward asked 19/10, 2016 at 13:13

1

Solved

How can I print a date/time without leading zeros? For example, Jul 5, 9:15. According to the docs it uses the same syntax as strftime, however suppressing leading zeros time::strftime("%b %-d, ...
Nonparticipation asked 5/7, 2016 at 20:15

4

Solved

How do I convert the following Objective-C code into Swift code? #define MAX_SIZE 11 char buffer[MAX_SIZE]; time_t time = [[NSDate date] timeIntervalSince1970]; strftime(buffer, MAX_SIZE, "%-l:%M\...
Borrow asked 17/6, 2014 at 2:50

4

Solved

I used : utctime = datetime.datetime(1601,1,1) + datetime.timedelta(microseconds = tup[5]) last_visit_time = "Last visit time:"+ utctime.strftime('%Y-%m-%d %H:%M:%S') But I have the time of 1601,...
Commencement asked 21/4, 2012 at 23:32

3

Solved

I'm trying to change the format of a datetime column in my Dataframe using lambda and strftime like below df['Date Column'] = df['Date Column'].map(lambda x: x.strftime('%m/%d/%Y')) However, sin...
Maleficence asked 18/2, 2016 at 17:10

5

Solved

I'm using strftime to display future date. But while using strftime('%a., %d. %B %Y',time()+60*60*24*4) I'm getting Mo., 01. April 2013 instead of Su., 31. March 2013 while using this today. (...
Libb asked 27/3, 2013 at 22:29

1

>>> import time >>> t=1440935442 >>> time.strftime("%Y/%m/%d-%H:%M:%S %z",time.gmtime(t)) '2015/08/30-11:50:42 +0000' >>> time.strftime("%Y/%m/%d-%H:%M:%S %z",ti...
Schoolteacher asked 2/9, 2015 at 12:21

1

Sorry if this is a dupe - lots of similar questions but obviously if I could find an exact answer I wouldn't be asking :) Note I'm coming from .Net and am a PHP newbie, so there may be noob-scale e...
Oxalis asked 20/4, 2014 at 16:42

5

Solved

I'm trying to convert a string "20091229050936" into "05:09 29 December 2009 (UTC)" >>>import time >>>s = time.strptime("20091229050936", "%Y%m%d%H%M%S") >>>print s.strf...
Genitourinary asked 23/2, 2010 at 9:29

1

Solved

My goal is to query Items by their user_id, year created, and month created. I am using sqlite3 in development and postresql in production on Heroku. I want to do something like this: items.where...
Cartwell asked 20/4, 2015 at 4:20

© 2022 - 2024 — McMap. All rights reserved.