time

Calculating time duration from two time values with no date in R

南楼画角 提交于 2021-02-05 06:51:37
问题 I am trying to calculate sleep duration, in hours, from two times self-reported in a diary. I have the bed and wake times in 24-hour format (for bedtimes, for instance, "23:00" is 11PM, "0:00" is midnight, "1:00" is 1AM; for wake times, "9:00" is 9AM). I thought the difftime function would be good to extract the sleep duration, but I am running into an issue with some of the cases. df$duration2<-difftime(df$Waketime2, df$Bedtime2, units="hours") In running the syntax above, it correctly

Calculating time duration from two time values with no date in R

て烟熏妆下的殇ゞ 提交于 2021-02-05 06:50:19
问题 I am trying to calculate sleep duration, in hours, from two times self-reported in a diary. I have the bed and wake times in 24-hour format (for bedtimes, for instance, "23:00" is 11PM, "0:00" is midnight, "1:00" is 1AM; for wake times, "9:00" is 9AM). I thought the difftime function would be good to extract the sleep duration, but I am running into an issue with some of the cases. df$duration2<-difftime(df$Waketime2, df$Bedtime2, units="hours") In running the syntax above, it correctly

How can I represent and operate on time values greater than 24:00 in Java?

拜拜、爱过 提交于 2021-02-05 05:36:10
问题 I'm currently doing some work in an application domain that uses time values greater than 24:00 to represent times after midnight that are still associated with the previous day's details. For instance, it might use 25:15 on Monday to represent 1:15 AM on Tuesday, since from a domain standpoint, this value is still associated with Monday's data. This type of time usage is briefly mentioned in the Wikipedia article for the 24-hour clock: Time-of-day notations beyond 24:00 (such as 24:01 or 25

Convert yyyy-mm-dd to UTC in Javascript

本秂侑毒 提交于 2021-02-05 02:36:45
问题 I need to convert a date in yyyy-mm-dd like 2011-12-30 to UTC using only javascript. How? 回答1: var utc = new Date('2011-12-30').toUTCString(); jsFiddle. 回答2: If you're having problems getting the other listed solution to work in firefox or safari you can use: http://www.datejs.com/ myDate = new Date.parse("2011-12-30") myUTCDate = Date.UTC(myDate.getFullYear(), myDate.getMonth(), myDate.getDate(), myDate.getHours(), myDate.getMinutes(), myDate.getSeconds(), myDate.getMilliseconds()); Voila!!

Convert yyyy-mm-dd to UTC in Javascript

做~自己de王妃 提交于 2021-02-05 02:34:31
问题 I need to convert a date in yyyy-mm-dd like 2011-12-30 to UTC using only javascript. How? 回答1: var utc = new Date('2011-12-30').toUTCString(); jsFiddle. 回答2: If you're having problems getting the other listed solution to work in firefox or safari you can use: http://www.datejs.com/ myDate = new Date.parse("2011-12-30") myUTCDate = Date.UTC(myDate.getFullYear(), myDate.getMonth(), myDate.getDate(), myDate.getHours(), myDate.getMinutes(), myDate.getSeconds(), myDate.getMilliseconds()); Voila!!

Time based Enable/Disable Add to Cart in Woocommerce

依然范特西╮ 提交于 2021-02-04 20:50:50
问题 I would like my online shop to be deactivated or activated for a certain period of time. When the shop is deactivated, you can see the products, but can't put them in the shopping cart. If you already have things in your shopping cart, you can't checkout and pay. Despite all this, you can see the products, but you can't buy them. Shop time would be as follows: Online: Monday to Sunday from 12 am to 22 pm Offline: the remaining time is to be deactivated Is that possible? I've already found a

Time based Enable/Disable Add to Cart in Woocommerce

帅比萌擦擦* 提交于 2021-02-04 20:48:08
问题 I would like my online shop to be deactivated or activated for a certain period of time. When the shop is deactivated, you can see the products, but can't put them in the shopping cart. If you already have things in your shopping cart, you can't checkout and pay. Despite all this, you can see the products, but you can't buy them. Shop time would be as follows: Online: Monday to Sunday from 12 am to 22 pm Offline: the remaining time is to be deactivated Is that possible? I've already found a

Is UTC_TIMESTAMP() affected by daylight savings?

廉价感情. 提交于 2021-02-04 19:08:21
问题 I am writing an app that has a time slot booking system. The users can be in different timezones, thus I need to store the values in the database in UTC time. I was wondering how UTC_TIMESTAMP() is calculated in MySQL. Is it reliable? If the server timezone is in an area with daylight savings will UTC_TIMESTAMP() always behave correctly, even during time changes due to daylight savings? 回答1: UTC is always +0:00 - it ignores daylight savings, regardless of whether or not it is in effect. In

When is it ok to store datetimes as local time rathen than UTC?

主宰稳场 提交于 2021-02-04 16:47:37
问题 This is a question similar to this one. I'm really tempted to store datetimes in my app as local time rather than as UTC (which is considered a best practice). In the app I have a number of events happening, each assigned to a given location. Always when I display them to the user, I want to show the local time of the event. I.e.: ==================================================================================== Event time (with TZ) | As UTC | As local time | To be displayed | =============

When is it ok to store datetimes as local time rathen than UTC?

久未见 提交于 2021-02-04 16:47:22
问题 This is a question similar to this one. I'm really tempted to store datetimes in my app as local time rather than as UTC (which is considered a best practice). In the app I have a number of events happening, each assigned to a given location. Always when I display them to the user, I want to show the local time of the event. I.e.: ==================================================================================== Event time (with TZ) | As UTC | As local time | To be displayed | =============