time

Converting Excel Time to moment.js

微笑、不失礼 提交于 2020-06-28 06:56:05
问题 I have an Electron app where an Excel-Sheet with a couple of columns containing time values needs to be imported. In my app those values are converted in a loop to momentjs object for further manipulation: x['Time'] = moment(x['Time'], ['HH:mm','HH:mm:ss']).format('HH:mm:ss'); This works fine as long the Excel contains time values formatted as text. But if the Excel is set up the way it's meant to be, then the value of the Cell is a Number between 0 and 1 (Excel counts time internally as

Convert number of minutes to hh:mm

╄→尐↘猪︶ㄣ 提交于 2020-06-27 13:07:50
问题 I have a column in a table that stores the number of minutes as a numeric(18,4) field named [course_access_minutes] . The stored values come from a blackboard database and look like this: 0.0500 0.0667 0.3667 up to 314.0833 625.8167 How do I convert these to time hh:mm, I've had a good look at the database documentation and all I can find is course_access_minutes numeric(18,4) This is the number of minutes that the user accesses this course in total during this login session. Can I assume

How to get start time and end time of a day in another timezone in Android

若如初见. 提交于 2020-06-25 07:08:52
问题 I've the date in format: YYYY-MM-DD Output format required is: "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" And I want to get the date in ISO format as Start time of the day(starts from 12:00AM) and end time of the day(ends on 11:59PM) in America/Chicago timezone. For eg. For the date: 2020-06-08 (June 8) the converted final output is like: Start time of the day as Date: 2020-06-08T05:00:00.000Z End time of the day as Date: 2020-06-09T04:59:59.999Z Please help me here if anybody has any clue for the same.

Drools - Repeated Events and Temporal Relations

一笑奈何 提交于 2020-06-24 13:43:48
问题 In general I am writing rules for events which equal (by attributes values) events can occur any time in consecutive manner (every second). I want to fire rules for matched events only on an hourly bases. In more details: I want to fire a rule when an event is inserted for the first time (not exist yet) OR when an event is inserted and if and only if equal events are already inserted to the working memory BUT the newest of them is at least one hour ago old. What is a reasonable way of writing

Drools - Repeated Events and Temporal Relations

余生长醉 提交于 2020-06-24 13:43:06
问题 In general I am writing rules for events which equal (by attributes values) events can occur any time in consecutive manner (every second). I want to fire rules for matched events only on an hourly bases. In more details: I want to fire a rule when an event is inserted for the first time (not exist yet) OR when an event is inserted and if and only if equal events are already inserted to the working memory BUT the newest of them is at least one hour ago old. What is a reasonable way of writing

Matplotlib: Automatically displaying time column as 2 hour ticks on y axis in scatterplot

我与影子孤独终老i 提交于 2020-06-23 09:07:22
问题 I have this data: Time = ['2017-03-13 00:01:00', '2017-03-13 00:02:00', '2017-03-13 23:59:00'] Speed = [20, 40.5, 100] Kilometer = [1.4, 2.0, 4.1] N130317 = pd.DataFrame({'Time':Time, 'Speed':Speed, 'Kilometer':Kilometer}) I have converted the time using: N130317['Time'] = pd.to_datetime(N130317['Time'], format = '%Y-%m-%d %H:%M:%S') N130317['Time'] = pd.to_datetime(N130317['Time'], format).apply(lambda x: x.time()) N130317['Time'] = N130317['Time'].map(lambda t: t.strftime('%H:%M')) I have

Interrupting readline() after a time interval in R

99封情书 提交于 2020-06-23 08:49:29
问题 How to break a loop after a certain elapsed time? I have a function that collects observational data from a user. The user should have a pre-defined time limit, when the data are recorded (30 sec in the example). At the moment, the function breaks, if the user-input arrives later than the end of the time limit. record.events <- function(duration = 30, first.event = "a"){ # Initial settings time.start <- proc.time()[3] events <- c(first.event, 0) # Timed data collection while(proc.time()[3] -

How do you represent MS-DTYP `DATETIME` in Java 8 Instant?

匆匆过客 提交于 2020-06-23 08:32:27
问题 In the Microsoft Spec, DATETIME is represented as 2 32-bit integers: low and high Reference: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/cca27429-5689-4a16-b2b4-9325d93e4ba2 The FILETIME structure is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since January 1, 1601, Coordinated Universal Time (UTC). typedef struct _FILETIME { DWORD dwLowDateTime; DWORD dwHighDateTime; } FILETIME, *PFILETIME, *LPFILETIME; dwLowDateTime: A 32

How do you represent MS-DTYP `DATETIME` in Java 8 Instant?

江枫思渺然 提交于 2020-06-23 08:32:10
问题 In the Microsoft Spec, DATETIME is represented as 2 32-bit integers: low and high Reference: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/cca27429-5689-4a16-b2b4-9325d93e4ba2 The FILETIME structure is a 64-bit value that represents the number of 100-nanosecond intervals that have elapsed since January 1, 1601, Coordinated Universal Time (UTC). typedef struct _FILETIME { DWORD dwLowDateTime; DWORD dwHighDateTime; } FILETIME, *PFILETIME, *LPFILETIME; dwLowDateTime: A 32

Explaination of time format (Google Directions API)

我的梦境 提交于 2020-06-18 14:05:55
问题 I have read the documentation of the Google Directions API for making a direction request. An example of a URL is given as http://maps.googleapis.com/maps/api/directions/json?origin=Brooklyn&destination=Queens&sensor=false&departure_time=1343605500&mode=transit The value of the departure_time variable is supposed to reflect the following information: July 30, 2012 at 09:45 am. Can someone please explain this time format. Thanks. 回答1: It's a timestamp - seconds elapsed since the Unix epoch,