datetime-format

DateTime error 21-undefined-2014 [duplicate]

不羁的心 提交于 2019-12-13 02:29:57
问题 This question already has answers here : DateTime formatting 3 letter month (2 answers) Closed 4 years ago . The code below results in: 21-undefined-2014 Not sure what is missing. Please check and advise. Everything else seems to be working correctly. Thank you. function onOpen() { var ui = DocumentApp.getUi(); // Or FormApp or SpreadsheetApp. ui.createMenu('Custom Menu') .addItem('Insert Date', 'insertDate') .addToUi(); } function insertDate() { var cursor = DocumentApp.getActiveDocument()

convert string to joda datetime gets stuck

限于喜欢 提交于 2019-12-13 02:25:44
问题 I'm trying to convert this string: 2014-01-01 00:00:00 to Joda DateTime I have tried the following: public static DateTime SimpleIso8601StringToDateTime(String date) { DateTimeFormatter df = DateTimeFormat.forPattern(CONSTS_APP_GENERAL.SIMPLE_DATE_FORMAT); return df.parseDateTime(date); } And also the following: public static DateTime SimpleIso8601StringToDateTime(String date) { DateTime dtDate = DateTime.parse(date, DateTimeFormat.forPattern(CONSTS_APP_GENERAL.SIMPLE_DATE_FORMAT)); return

Swift - Convert date and time object from server to local time on iphone

若如初见. 提交于 2019-12-13 02:25:18
问题 I make a request to my database with php (laravel) which return a date object as follow: "lastMessageDate" : { "date" : "2016-06-06 23:37:32.000000", "timezone" : "UTC", "timezone_type" : 3 } How can I convert this object to the local date and time of the iPhone in swift? Thank you. 回答1: import Foundation let serverDateFormatter: NSDateFormatter = { let result = NSDateFormatter() result.dateFormat = "yyyy-MM-dd HH:mm:ss.SSSSSS" result.timeZone = NSTimeZone(forSecondsFromGMT: 0) return result

can hibernate convert date field into given timezone at transaction or session level?

瘦欲@ 提交于 2019-12-12 22:50:15
问题 We are working on a feature to store 'date' in a given timezone, irrespective of the current JVM timezone. It is important for me to store it in a given timezone, because lot of other existing systems needs it that way. I know we can set the current timezone of the JVM and everything will work. But we have requests coming from different timezones concurrently, which will break with above approach. Can we do something similar to the timezone setting of JVM @ transaction or session level in

Understanding Intl.DateTimeFormat as a JavaScript object

此生再无相见时 提交于 2019-12-12 18:08:52
问题 I do not understand the behavior of Intl.DateTimeFormat . It does not expose the behavior I would expect from a JavaScript object. I would like to understand why? The following snippet demonstrates that the format method on DateTimeFormat can't be overridden. How is this possible? const itDateTimeFormat1 = new window.Intl.DateTimeFormat('it-CH'); const originalFormat = itDateTimeFormat1.format; itDateTimeFormat1.format = function(date){ return 'Overriden! ' + originalFormat(date)}; console

date format in d3, would like to have month as an integer instead of decimal

半腔热情 提交于 2019-12-12 10:03:25
问题 I would like to have format as 6/19 instead of 06/19 for my X axis. It does not seem to provide a way of doing so on its official documentation: https://github.com/mbostock/d3/wiki/Time-Formatting Any clues? Thanks? 回答1: See the part about padding: The % sign indicating a directive may be immediately followed by a padding modifier: 0 - zero-padding _ - space-padding - - disable padding For example, "%-m/%-d" will disable padding for both the month and date, giving you "6/1" for June 1st, as

How to set a value for the input type 'datetime-local'?

蓝咒 提交于 2019-12-12 07:11:58
问题 I tried this: <input type="datetime-local" value="<?php echo $row['Time']; ?>" class="date" name="start" REQUIRED> How can I set the value of this input field with the data from the database? It doesn't work!! I need to make it possible to edit too. Or should I use another type of input? $row['Time'] is from the database! 回答1: I don't know exacly what is in $row['Time'] but it should be as follows: Definition A valid date-time as defined in RFC 3339 with these additional qualifications: the

String was not recognized as a valid parameter for DateTime.ParseExact

白昼怎懂夜的黑 提交于 2019-12-12 06:23:52
问题 I'm using this code: var sec = "163516"; TimeSpan time = TimeSpan.FromSeconds(double.Parse(sec)); DateTime butikDatetime = DateTime.Today.Add(time); string dateTime = butikDatetime.ToString("dd-MM-yy HH:mm:ss"); DateTime date = DateTime.ParseExact(dateTime, "dd-MM-yy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture); But receive this error for ParseExact: Additional information: String was not recognized as a valid DateTime. Somebody have an idea what is wrong? 回答1: You are

D3 time format skips isoWeek

坚强是说给别人听的谎言 提交于 2019-12-12 05:48:43
问题 When using d3.time.format(%Y%W) it doesn't give the expected output. d3.time.format("%Y%W").parse("201553") outputs Mon Jan 04 2016 Although the first Monday of week number 53 in 2015 is Mon Dec 28 2015 So it seems like it parses to the next week. Any ideas how to fix this to get the expected output. 来源: https://stackoverflow.com/questions/37568973/d3-time-format-skips-isoweek

Convert TimeSpan.TotalMilliseconds to datetime and format it as hour:minute

孤街浪徒 提交于 2019-12-12 05:30:02
问题 I kinda confuse about the date time conversion in my model i have defined public DateTime? Sent { get; set; } public DateTime? Reply { get; set; } public double ResponseTime { get; set; } in linq part i am using ResponseTime = (u.Reply - u.sent).TotalMilliseconds which is not formated and displayed like this 979809803 I want to know how do i convert it to datetime format, and eventually will display the format as hour:minute, for instance 2:45 between the date sent and date reply. 回答1: