date-formatting

PHP IntlDateFormatter wrong date/time conversion

女生的网名这么多〃 提交于 2019-12-12 19:38:47
问题 I recently stumbled on a problem with PHP v7.0.4. when trying to format some dates in the past. I work on a project, in which there is a thing called "empty date", basically a "1800-01-01" (used instead of the NULL value). I'm using GMT+1, "Europe/Berlin". In process of handling it, and with the Date localization involved, the IntlDateFormatter started making some issues and I chased them down to having exceptions if the dates are <= 1893-04-01 (an early April fool thing?). You can see some

PHPExcel date required dd/MM/yy

不羁岁月 提交于 2019-12-12 17:08:04
问题 I am using PHPExcel Lib to download excel sheet and have required the column date format like 25-May-17 instead of 25-05-17 in my download excel sheet. I was able to added number format 25-05-17 but not like 25-May-17 and below is my code like. $objPHPExcel->getActiveSheet() ->getStyle('V'.$i) ->getNumberFormat() ->setFormatCode( PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY ); I can not find the constant in Lib class const FORMAT_DATE_YYYYMMDD2 = 'yyyy-mm-dd'; const FORMAT_DATE_YYYYMMDD

TO_CHAR and TO_DATE giving different results.How to achieve the TO_CHAR functionality using TO_DATE?

浪子不回头ぞ 提交于 2019-12-12 13:25:10
问题 SELECT TO_CHAR((select logical_date -1 from logical_date where logical_date_type='B'),'DD/MM/YYYY HH24:MI:SS') FROM DUAL; This Query returns 23/04/2016 00:00:00 o/p of select logical_date -1 from logical_date where logical_date_type='B' :4/23/2016 SELECT TO_DATE((select logical_date -1 from logical_date where logical_date_type='B'),'DD/MM/YYYY HH24:MI:SS') FROM DUAL; This Query returns 4/23/0016 . How do I get the format given by TO_CHAR using TO_DATE ?? 回答1: Dates do not have any intrinsic

Excel VBA - Date Format Conversion

吃可爱长大的小学妹 提交于 2019-12-12 09:59:41
问题 I have come across a challenging task which I am not able to solve using many workarounds. In one column I have dates, the date can be in following three formats: 1) Simple dd/mm/yy 2) dd/mm/yy but may have words "before,after or about" around it. Any one of it and we just need to delete those words in this case. 3) Date in a numeric format. A long decimal values like 1382923.2323 but actually I can get a date from it after conversion. The file is uploaded here. Date_format_macro_link I wrote

How to remove time-field string from a date-as-character variable?

被刻印的时光 ゝ 提交于 2019-12-12 07:34:43
问题 Suppose I have a variable like this c<-c("9/21/2011 0:00:00", "9/25/2011 0:00:00", "10/2/2011 0:00:00", "9/28/2011 0:00:00", "9/27/2011 0:00:00") what's a quick way to remove all 0:00:00 s so that c [1] "9/21/2011" "9/25/2011" "10/2/2011" "9/28/2011" "9/27/2011" 回答1: You can turn them into dates and then format as desired, e.g.: v <- c("9/21/2011 0:00:00", "9/25/2011 0:00:00", "10/2/2011 0:00:00", "9/28/2011 0:00:00", "9/27/2011 0:00:00") v <- format(as.POSIXct(v,format='%m/%d/%Y %H:%M:%S')

dd/mm/yyyy format in PHPExcel adding single quote(') in cell

别说谁变了你拦得住时间么 提交于 2019-12-12 05:07:53
问题 In my webpage, I am using PHPexcel 1.8 to generate excel files. Now I am facing an issue which describes below. I have some date values in the format dd/mm/yyyy . The value is coming. But it shows with a single quote(') at the begining. I tried many solutions. But none helps me out. My sample code portion is given below $cnt = 1; foreach($gluuidArr as $uuid){ $this -> excel_180->getActiveSheet() ->setCellValue('A'.$cnt,$aVal); $this -> excel_180->getActiveSheet() ->setCellValue('B'.$cnt,$bVal

Datepicker and allowing multiple input formats

℡╲_俬逩灬. 提交于 2019-12-12 04:34:09
问题 I've got a Datepicker and I'd like to allow multiple formats for users. For example, for the date January 5th 2014 I want to allow the following formats: 05-01-2014 : dd-MM-yyyy 5-01-2014 : d-MM-yyyy 5-1-2014 : d-M-yyyy 5-01-14 : d-MM-yy 5-1-14 : d-M-yy 05-1-2014 : dd-M-yyyy 05-1-14 : dd-M-yy 05-01-14 : dd-MM-yy 05012014 : ddMMyyyy 050114 : ddMMyy 512014 : dMyyyy 5114 : dMyy I did create the following test-converter: public class DatepickerConverter : IValueConverter { public object Convert

Converting Dates Freemarker

半城伤御伤魂 提交于 2019-12-12 02:34:20
问题 I'm trying to get the following to work but I can't get the correct value to display. Assuming SHIPPING_DATE is treated as a string with the value = 2016/05/23: <#setting date_format="MM/dd/yyyy"> <#setting locale="en_US"> <#assign ship_date>${SHIPPING_DATE}</#assign> ${ship_date?date("MM/dd/yyyy")} The output is 12/05/0190 but I'm expecting 05/23/2016 . Will someone help but also explain what I'm doing wrong, please? 回答1: If you have a string in ship_date like 2016/05/23 , then you can parse

Check if the current date string is within or outside the range of two other dates

我与影子孤独终老i 提交于 2019-12-12 01:55:40
问题 I have 2 date pickers. One is for selecting a start date and the other is for selecting an expiry date. When a selection has been made I convert the date to string format and store the results in a two text fields. This is how I save to the database: let dateFormatter = NSDateFormatter() dateFormatter.dateFormat = "MMMM d" // e.g. September 15 let sDate = dateFormatter.dateFromString(startDateField.text) as NSDate! let eDate = dateFormatter.dateFromString(expiryDateField.text) as NSDate!

How to Change time format of date string using timeoffset [duplicate]

筅森魡賤 提交于 2019-12-12 01:22:06
问题 This question already has answers here : Strange Java Timezone Date Conversion Problem (3 answers) Closed 10 months ago . I am trying to convert date string to UTC format from another time zone in Java. we have only time zone offset like "-06:00". Can any one help me how to convert the date time to UTC format using time zone offset. Thanks This for java version 1.7 . I have tried with following snippet but receiving the same input as output. String dateInString = "02/04/2019 18:17:15";