date

VBA local timezone adjustment

≯℡__Kan透↙ 提交于 2020-12-11 04:51:29
问题 Say I have a local Pacific Time (UTC-8) Excel value. For example 41656.67297 is 17 January 2014 4:09 PM . I do not have control of this value. I want to adjust the given value relative to the users local time. Say for example someone in Dublin is using the Excel workbook. I want to adjust the given number and display it in his local time, 18 January 2014 12:09 AM . Is there any built in Excel functionality to make this smooth? 回答1: VBA doesn't provide an option for this natively, but there's

Calendar.getTime() fails with java.lang.IllegalArgumentException:MINUTE for Asia/Singapore timezone

天涯浪子 提交于 2020-12-11 01:04:19
问题 Why is this code failing? The purpose was to remove the time part. String dateStr = "1982-01-01"; String timeZoneID = "Asia/Singapore"; DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date = dateFormat.parse(dateStr); Calendar calendar = Calendar.getInstance(); calendar.setTimeZone(TimeZone.getTimeZone(timeZoneID)); calendar.setLenient(false); calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0);

Calendar.getTime() fails with java.lang.IllegalArgumentException:MINUTE for Asia/Singapore timezone

眉间皱痕 提交于 2020-12-11 01:00:28
问题 Why is this code failing? The purpose was to remove the time part. String dateStr = "1982-01-01"; String timeZoneID = "Asia/Singapore"; DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date = dateFormat.parse(dateStr); Calendar calendar = Calendar.getInstance(); calendar.setTimeZone(TimeZone.getTimeZone(timeZoneID)); calendar.setLenient(false); calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0);

Calendar.getTime() fails with java.lang.IllegalArgumentException:MINUTE for Asia/Singapore timezone

冷暖自知 提交于 2020-12-11 01:00:16
问题 Why is this code failing? The purpose was to remove the time part. String dateStr = "1982-01-01"; String timeZoneID = "Asia/Singapore"; DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date = dateFormat.parse(dateStr); Calendar calendar = Calendar.getInstance(); calendar.setTimeZone(TimeZone.getTimeZone(timeZoneID)); calendar.setLenient(false); calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0);

Calendar.getTime() fails with java.lang.IllegalArgumentException:MINUTE for Asia/Singapore timezone

余生颓废 提交于 2020-12-11 00:56:09
问题 Why is this code failing? The purpose was to remove the time part. String dateStr = "1982-01-01"; String timeZoneID = "Asia/Singapore"; DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date = dateFormat.parse(dateStr); Calendar calendar = Calendar.getInstance(); calendar.setTimeZone(TimeZone.getTimeZone(timeZoneID)); calendar.setLenient(false); calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0);

Calendar.getTime() fails with java.lang.IllegalArgumentException:MINUTE for Asia/Singapore timezone

a 夏天 提交于 2020-12-11 00:50:26
问题 Why is this code failing? The purpose was to remove the time part. String dateStr = "1982-01-01"; String timeZoneID = "Asia/Singapore"; DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); Date date = dateFormat.parse(dateStr); Calendar calendar = Calendar.getInstance(); calendar.setTimeZone(TimeZone.getTimeZone(timeZoneID)); calendar.setLenient(false); calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0);

Force Jackson serialize LocalDate to Array

蹲街弑〆低调 提交于 2020-12-10 08:42:27
问题 I'm using spring-boot 2.1.6 and there is an API to accept a form including a date like: @Data public class MyForm { private LocalDate date; ... } @Controller public class MyController { @PostMapping("...") public ResponseEntity<...> post(@RequestBody MyForm myForm) { ... } } By default spring MVC accept this JSON format: { "date": [2020, 6, 17], ... } So in Front-End, my JavaScript code just submit a form like this, i.e. JS will convert a date to an array. But when I run spring-boot test,

Javascript - Retrieve OS Date formatting

别说谁变了你拦得住时间么 提交于 2020-12-08 12:00:18
问题 Hmmm... Okay so I've been searching the web for 2 days now without any luck. I've seen a lot of answers on how to format a javascript date for example new Date().toString("yyyy-MM-dd")... Which would return something like 2013-04-05. This is absolutely not the problem. What I want, is the possibility to set the format in which my OS displays dates, then retrieve that specific format and display it in the browser. For example, let's say I changed the format of the date in my OS to MM-yyyy/dd

Javascript - Retrieve OS Date formatting

风流意气都作罢 提交于 2020-12-08 11:55:56
问题 Hmmm... Okay so I've been searching the web for 2 days now without any luck. I've seen a lot of answers on how to format a javascript date for example new Date().toString("yyyy-MM-dd")... Which would return something like 2013-04-05. This is absolutely not the problem. What I want, is the possibility to set the format in which my OS displays dates, then retrieve that specific format and display it in the browser. For example, let's say I changed the format of the date in my OS to MM-yyyy/dd

Javascript - Retrieve OS Date formatting

十年热恋 提交于 2020-12-08 11:54:27
问题 Hmmm... Okay so I've been searching the web for 2 days now without any luck. I've seen a lot of answers on how to format a javascript date for example new Date().toString("yyyy-MM-dd")... Which would return something like 2013-04-05. This is absolutely not the problem. What I want, is the possibility to set the format in which my OS displays dates, then retrieve that specific format and display it in the browser. For example, let's say I changed the format of the date in my OS to MM-yyyy/dd