datetime

select first in and last out time - different date - from data finger

允我心安 提交于 2021-02-10 17:45:47
问题 Here is my data finger table, [dbo].[tFPLog] CardID Date Time TransactionCode 100 2020-09-01 08:00 IN 100 2020-09-01 17:00 OUT 100 2020-09-01 17:10 OUT 200 2020-09-01 16:00 IN 200 2020-09-02 02:00 OUT 200 2020-09-02 02:15 OUT 100 2020-09-02 07:00 IN 100 2020-09-02 16:00 OUT 200 2020-09-02 09:55 IN 200 2020-09-02 10:00 IN 200 2020-09-02 21:00 OUT Conditions Assume Employees will be IN and OUT in same day/next day. Assume There will be multiple IN and OUT for same day/next day for employees. So

Changing DateTime format in lambda Expression

自闭症网瘾萝莉.ら 提交于 2021-02-10 16:02:37
问题 I have a DTO field in DateTime format public DateTime date_joined { get; set; } I use this to turn the data into a Json public JsonResult Customer(int? id) { var user = User.Identity.Name; if (!AccountController.IsInRole(user, "admin")) { return null; } id = id == null ? 0 : id; var customer = db.PrmCustomers .Where(x => x.EmailAddress != null && x.CustomerID > id) .OrderBy(x => x.CustomerID) .Select(x => new CustomerDTO() { email = x.EmailAddress, phone = x.MobilePhoneNumber, username = "",

How to make an axes occupy multiple subplots when using pandas datetime plot?

感情迁移 提交于 2021-02-10 16:01:19
问题 I would like to create a (sub)plot with two rows and two columns where the plot in the lower row occupies both axes. Since I use the plot from within pandas datetime (I think) I was not able to use this solution. fig, axes = plt.subplots(nrows=2, ncols=2) df1.set_index('Date').plot(ax=axes[0,0]) df2.set_index('Date').plot(ax=axes[0,1]) df3.set_index('Date').plot(ax=axes ??? ) How do I need to assign the axes (if at all possible) in order to get something like this: 回答1: You can do in this way

How to make an axes occupy multiple subplots when using pandas datetime plot?

北慕城南 提交于 2021-02-10 16:00:22
问题 I would like to create a (sub)plot with two rows and two columns where the plot in the lower row occupies both axes. Since I use the plot from within pandas datetime (I think) I was not able to use this solution. fig, axes = plt.subplots(nrows=2, ncols=2) df1.set_index('Date').plot(ax=axes[0,0]) df2.set_index('Date').plot(ax=axes[0,1]) df3.set_index('Date').plot(ax=axes ??? ) How do I need to assign the axes (if at all possible) in order to get something like this: 回答1: You can do in this way

How to convert ISO 8601 formatted DateTime to another time zone in Java?

风格不统一 提交于 2021-02-10 15:12:37
问题 My current date: Date utc: 2018-06-06T16:30:00Z (ISO 8601 in UTC) OR Date iso: 2018-06-06T11:30:00-05:00 (ISO 8601) OR Date epoch: 1528302600000 (Epoch/Unix Timestamp) I wish to convert the above DateTime to some another time zone areas (like GMT+5:30). And I'm not sure which time format I'll receive from above three. So can I've a generic method which can convert above to some another time zone returning java.util.Date in Java 8? I did Something like this, But it didn't worked out public

How to convert a list of dictionary values containing Timesamp objects into datetime objects in Python?

断了今生、忘了曾经 提交于 2021-02-10 14:41:53
问题 I have a dictionary containing results of a user's social media activity, the values of the dictionary are in a list containing Timestamp objects and I want to convert it to time objects (datetime.time()) here is the dictionary {{'Instagram':[Timestamp('2020-08-23 04:16:05.12456'), Timestamp('2020-08-23 04:17:02.88754'), Timestamp('2020-08-23 05:20:21.43215'), Timestamp('2020-08-23 06:21:19.63441'), Timestamp('2020-08-23 08:23:15.76421')]}, {'Twitter':[Timestamp('2020-08-23 05:19:12.21245'),

Difference between consecutive dates in pandas groupby [duplicate]

时光总嘲笑我的痴心妄想 提交于 2021-02-10 13:22:09
问题 This question already has an answer here : Pandas find duration between dates where a condition is met? (1 answer) Closed 2 years ago . I have a data-frame as follows: df_raw_dates = pd.DataFrame({"id": [102, 102, 102, 103, 103, 103, 104], "val": [9,2,4,7,6,3,2], "dates": [pd.Timestamp(2002, 1, 1), pd.Timestamp(2002, 3, 3), pd.Timestamp(2003, 4, 4), pd.Timestamp(2003, 8, 9), pd.Timestamp(2005, 2, 3), pd.Timestamp(2005, 2, 8), pd.Timestamp(2005, 2, 3)]}) id val dates 0 102 9 2002-01-01 1 102 2

How do I parse dates with more than 24 hours in dateutil's parser in Python 3?

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-10 13:20:05
问题 I currently have a bunch of times in a column written like "27:32:18", meaning someone was waiting for 27 hours, 32 minutes, and 18 seconds. I keep getting "ValueError: hour must be in 0..23" whenever I try to parse these values. How should I go about parsing those values or converting them to a more standard format? I tried the following as a test on a single value: time1 = "56:42:12" time2 = time1.split(':') time2 = [int(n) for n in time2] time2.insert(0, time2[0] // 24) time2[1] %= 24 At

How to display total workdays in month and current workday javascript

北慕城南 提交于 2021-02-10 12:52:46
问题 Was searching for a solution to display the current workday over the total workdays in the current month. Workdays in this case are defined as Mon , Tues , Wed , Thurs , & Fri . Closest solution I found was this: How to find business days in current month with Javascript? Using this post's suggested answer with a slight edit, how can I edit this to display the current workday and total workdays in the month? Here is my CodePen attempt. HTML: <h3>Get workdays in current month with JavaScript<

Moment.js 24-hour time format, dealing with the 24th hour

家住魔仙堡 提交于 2021-02-10 12:01:39
问题 I am using momentjs to check difference in minutes between two time stamps of a train trip. The API that I'm using to grab the data from returns times in 24 hours format (momentjs: HH:mm:ss). If the trip continues to the next day, the time is shown as, for example, "24:12:00" which is pretty weird. Momentjs can't deal with this, and if I try to calculate time difference with such values I get "NaN". So I created a function to convert any "24" occurrence to "00". function maintainHour