localtime Questions

3

I am given LocalDateTime object created from String. I want to check whether that original string has "seconds" parameter or not. My two inputs are: String a = "2016-06-22T10:01"; //not given Stri...
Internal asked 23/6, 2017 at 8:2

6

Solved

Using the java.time framework, I want to print time in format hh:mm:ss, but LocalTime.now() gives the time in the format hh:mm:ss,nnn. I tried to use DateTimeFormatter: DateTimeFormatter formatter...
Heathenism asked 27/8, 2014 at 20:38

2

Solved

Given a LocalTime in a given ZoneId, how can I find the adjusted LocalTime on UTC? I am looking for something similar to .atZone from LocalDateTime, but couldn't find anything. I suspect I can us...
Douro asked 7/6, 2017 at 14:52

2

Solved

DateTime dtStart = new DateTime(2015,7,28); LocalDate ldtStart = LocalDate.FromDateTime(dtStart); DateTime dtEnd = new DateTime(2017, 2, 1); LocalDate ldtEnd = LocalDate.FromDateTime(dtEnd); Peri...
Calbert asked 18/5, 2017 at 5:24

1

Solved

I have an entity that has a variable of type LocalTime and I would like to store it in database. So I have two questions: What data type will the field in mysql be? What annotation to use for ent...
Wetzell asked 15/4, 2017 at 0:40

2

Solved

I am confused with time handling in java time. I so long worked under the assumption that if a timestamp is specified as a zulu time, java would take care of the offset with regards to local time. ...
Ensiform asked 12/9, 2016 at 13:25

2

Solved

I had a piece of code that worked just fine and now somehow doesn't work. I am reading in a csv file and get an error when reading in a time field of the format 4:38. My code that throws the ex...
Ethnomusicology asked 19/8, 2016 at 8:36

1

I recently learned how to change the timezone returned by localtime in Perl. use POSIX qw(tzset); print localtime . "\n"; $ENV{TZ} = 'America/Los_Angeles'; print localtime . "\n"; tzset; print loc...
Andre asked 8/7, 2016 at 23:21

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 have two LocalTime objects: LocalTime l1 = LocalTime.parse("02:53:40"); LocalTime l2 = LocalTime.parse("02:54:27"); How can I found different in minutes between them?
Religious asked 5/2, 2015 at 20:49

1

Solved

I am working with a function in C++ to help get the integer for the month. I did some searching and found one that uses localtime but I do not want to set it up to remove warnings so I need to use ...
Gossoon asked 7/2, 2016 at 19:52

9

Solved

We're creating a scheduling application and we need to represent someone's available schedule during the day, regardless of what time zone they are in. Taking a cue from Joda Time's Interval, which...
Staceystaci asked 21/3, 2011 at 23:24

2

Solved

I need to convert a string to LocalTime (java-8 not joda) that may or maynot have nanoOfSeconds in the string. The String format is in the form of 07:06:05 or 07:06:05.123456 The string may or m...
Mccloskey asked 11/6, 2015 at 18:12

2

Solved

I'm afraid I don't really understand how .Net's DateTime class handles local timestamps (I live in Germany, so my locale is de_DE). Perhaps someone can enlighten me a bit ;-) The DateTime construc...
Chalcis asked 13/3, 2015 at 16:17

4

Solved

I'm looking for a way to save the time in a HH::MM::SS fashion in C++. I saw here that they are many solutions and after a little research I opted for time and localtime. However, it seems like the...
Lunatic asked 7/11, 2011 at 9:3

1

I have a DateTime that needs to be converted to a NodaTime LocalDate. Can this be done? I have this: DateTime modifiedDate = File.GetLastWriteTime(file); And I want this: LocalTime modifiedDa...
Tenfold asked 16/4, 2014 at 20:20

2

Solved

I am using JodaTime LocalTime in order to specify times. How can I get the difference in minutes between two times? LocalTime startT = new LocalTime(6,30); LocalTime endT = new LocalTime(12,15); ...
Impel asked 13/3, 2014 at 9:27

4

Solved

In Python, I can find the Unix time stamp of a local time, knowing the time zone, like this (using pytz): >>> import datetime as DT >>> import pytz >>> mtl = pytz.timezo...
Systole asked 29/11, 2013 at 0:10

1

Solved

Working on an Ubuntu 12.04.3 LTS box, I just noticed that localtime() and localtime_r() behave differently when the system's timezone changes during the lifetime of a process: localtime() picks up ...
Sharlasharleen asked 3/10, 2013 at 23:20

11

Solved

How do I get the Olson timezone name (such as Australia/Sydney) corresponding to the value given by C's localtime call? This is the value overridden via TZ, by symlinking /etc/localtime, or settin...
Restore asked 6/10, 2011 at 3:4

3

time_t rawtime; struct tm * timeinfo; time ( &rawtime ); timeinfo = localtime ( &rawtime ); This returns: warning C4996: 'localtime': This function or variable may be unsafe. Consider usi...
Dymphia asked 17/1, 2013 at 19:47

2

I am storing all the DateTime fields as UTC time. When a user requests a web page, I would like to take his preferred local timezone (and not the local timezone of the server machine) and automatic...
Quirita asked 2/5, 2013 at 19:6

7

I am wanting to get yesterday's date into a char in the format: YYYYMMDD (with no slashes dots etc.). I am using this code to get today's date: time_t now; struct tm *ts; char yearchar[80]; ...
Vladikavkaz asked 20/1, 2011 at 15:26

3

Solved

I was wondering if there is an in-built Perl function that adjusts the date if you take a month from it. E.g. if date is the 31st, it will adjust to be the end of the previous month if it doesn't h...
Vespiary asked 29/8, 2012 at 11:12

2

Solved

I have a setup working using localtime() to get a tm with the local times represented in it. And that is all good. However, if I change timezone while the application is running, it does not notic...
Kudos asked 11/1, 2012 at 17:52

© 2022 - 2025 — McMap. All rights reserved.