date-formatting

Convert dd/mm/yy to dd-MM-YYYY format in xsl

泄露秘密 提交于 2019-12-11 15:48:38
问题 Thanks in advance for your support. I have the date formats as dd/MMM/YY and need to be converted into the another format dd-MM-YYYY using XSL . The problem here is, year is in short format need to be converted into long format. How can the year be determined ? Here are few examples, dd/MMM/YY - dd-MM-YYYY 01/FEB/91 - 01-02-1991. 13/APR/13 - 13-04-2013. Using string manipulations, XSL it can be converted to long format but actual year cannot be determined. For example 01/FEB/91 can be

Convert year-month string column into quarterly bins

痴心易碎 提交于 2019-12-11 12:25:51
问题 I am currently working with a large phenology data set, where there are multiple observations of trees for a given month. I want to assign these observations into three month clusters or bins. I am currently using the following code: Cluster.GN <- ifelse(Master.feed.parts.gn$yr.mo=="2007.1", 1, ifelse(Master.feed.parts.gn$yr.mo=="2007.11", 1,.... ifelse(Master.feed.parts.gn$yr.mo=="2014.05", 17, NA) This code works, but it is very cumbersome as there are over 50 months. I have had trouble

Swift 3 - UTC to time ago label, thinking 12h / 24h device time changes

≯℡__Kan透↙ 提交于 2019-12-11 04:36:28
问题 I want to convert timeUTC to "5s ago." ago label also thinking 12h / 24h changes on the phone. Because goes crash. Now below lines of code return label value what I want in the Playground. But not on my ios project. It doesn't go into If block. What I'm missing or What's the wrong with that? let dateStringUTC = "2016-10-22 12:37:48 +0000" let dateFormatter = DateFormatter() dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss ZZZ" if let from = dateFormatter.date(from: dateStringUTC) {

Convert year-month string to three month bins with gaps - how to assign contiguous ascending values?

守給你的承諾、 提交于 2019-12-11 04:15:38
问题 I have used the code below to "bin" a year.month string into three month bins. The problem is that I want each of the bins to have a number that corresponds where the bin occurs chronologically (i.e. first bin =1, second bin=2, etc.). Right now, the first month bin is assigned to the number 4, and I am not sure why. Any help would be highly appreciated! > head(Master.feed.parts.gn$yr.mo, n=20) [1] "2007.10" "2007.10" "2007.10" "2007.11" "2007.11" "2007.11" "2007.11" "2007.12" "2008.01" [10]

Comparing dates in MMYY format

我只是一个虾纸丫 提交于 2019-12-11 00:47:43
问题 So I am making a Java program that processes a user's fake credit card and I am trying to make an expiration verification conditional statement. However, when I run my program, I get a "String cannot be converted to int" error. I would like to know how should I use the current month and year to check if the date entered by the user has actually expired. do { System.out.print("Enter the expiration date mmyy: "); expiration = expnum.nextInt(); DateFormat dateformat = new SimpleDateFormat("MMyy"

Coldfusion date conversion: “2013-11-15T06:11:57.87 is an invalid date or time string”

Deadly 提交于 2019-12-10 17:46:13
问题 I am trying to convert a date from UTC to local and I am getting the following error: "2013-11-15T06:11:57.87 is an invalid date or time string" Here is the partial code: #DateFormat(DateConvert("utc2Local", apiResult.Created), 'm/d/yy')# As you have guessed apiResult.Created is 2013-11-15T06:11:57.87 Any ideas? Thank you 回答1: Your problem seems to be that the string 2013-11-15T06:11:57.87 is not a recognised date string format. You're probably going to have to parse it yourself. I found this

Inconsistent `w` symbol formatting from joda time to java.time

梦想的初衷 提交于 2019-12-10 17:29:02
问题 My team is looking to switch from Joda time to java.time , but we're seeing different behavior in formatting using the same pattern. The issue arises when we're using the week-of-week-year w symbol: final String dateString = "2016-01-04 00:00:00"; final String inputPattern = "yyyy-MM-dd HH:mm:ss"; // parse the input string using Joda final org.joda.time.format.DateTimeFormatter jodaInputFormatter = org.joda.time.format.DateTimeFormat.forPattern(inputPattern); final org.joda.time.DateTime

How to change date format using jQuery/Javascript?

空扰寡人 提交于 2019-12-10 15:45:43
问题 Today I want to transfrom date into different format using jQuery/Javascript : $date = '2013-04-01T19:45:11.000Z' $cool = date('Y-m-d',strtotime($date)); How can I do that (PHP) in jQuery/Javascript ? Thanks! 回答1: You need a date in such format for javascript Sun, 01 Sep 13 08:06:57 +0000 So in PHP you need to do something like this date_default_timezone_set('Australia/Perth'); echo date('D, d M y H:i:s')." +0000"; And you can experiment with jQuery to check it $.get('dateformat.php',

How to change the data format for the current culture so that it applies to the entire web application

你说的曾经没有我的故事 提交于 2019-12-10 15:29:35
问题 I would like to set the date format to ' YYYY-MM-DD ' for my entire web application. I can do this by creating an object of CultureAndRegionInfoBuilder and then registering it. But since my application is on a hosted environment , I cannot run executables to register the culture. I need a way to do this within the Application_Start so that it applies to the entire web app. I tried changing the date format using Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern , but it does

Java convert millisecond timestamp to date with respect to given timezone

给你一囗甜甜゛ 提交于 2019-12-10 11:28:51
问题 I have seen many resources on this but one thing I cant get is when converting the millisecond timestamp, how I add a corresponding time zone, during the conversion process. Date date = new Date(Long.valueOf(dateInMil*1000L); SimpleDateFormat myDate = new SimpleDateFormat("EEE, MMM d, ''yy"); String formatted = myDate.format(date); Now if I have a time zone/offset in string formate i.e. "-04:00" or "+2:00" how to apply it to the above so I can get the proper date ? 回答1: I was doing a similar