I have date in format 2009-02-07T15:23:00Z which needs to be converted to the format Mmm DD, YYYY in xslt.
How to achieve this? I have tried using <xsl:value-of select="format-dateTime()"/>
But not getting any output may be due to some mistake which i am not bake to figure it out.
Please let me know how this can be achieved?
Worked using xsl:choose and substring(date, 9, 2).
Related
I want to display my date in following format.
YYYY年MM月DD日
When I use the following method to format it;
DateFormat('dd MMM, yyyy', 'ja').format(bDate);
It does not display it the way I want.
What is the format method to get the date the way I want?
you can try this
DateFormat.yMMMMEEEEd('ja').format(bDate);
I have a few places where I need to change how the date format displays in my Alfresco share:
Calendar Format
Needs to be in MM/DD/YYYY format.
Date in Info.ftl Control
Needs to be in DDD MM DD YYYY format.
Date().toString()
This is being displayed in a data list. Ideally it should read: "Tue Jul 2015 8:27:51 (EST)"
I located common.properties and made the following changes:
## Date Formats
#Used client side (uses Alfresco.util.formatDate)
date-format.default=mmm ddd d yyyy HH:MM:ss
date-format.defaultDateOnly=mmm ddd d yyyy
date-format.shortDate=m/d/yy
date-format.mediumDate=mmm d, yyyy
date-format.mediumDateNoYear=mmm d
date-format.longDate=mmmm dd, yyyy
date-format.longDateNoYear=mmmm dd
date-format.fullDate=mmmm, d dddd, yyyy
date-format.fullDateTime=mmmm, d dddd, yyyy 'at' h:MM TT
date-format.shortTime=h:MM TT
date-format.mediumTime=h:MM:ss TT
date-format.longTime=h:MM:ss TT Z
date-format.monthYear=mmmm yyyy
date-format.dayDateMonth=mmmm, d dddd
date-format.am=am
date-format.pm=pm
But none of them seem to affect any date formats anywhere. My questions:
Where do I need to make additional changes to get the above formats to work?
How do I change the time zone?
Essentially, I need to change everything to Eastern US time zone and formats.
Different files where date format are mentioned. Each of them are responsible for rendering dates in different places
<ALF_HOME>\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\form\form.get_en.properties
<ALF_HOME>\tomcat\webapps\share\WEB-INF\classes\alfresco\messages\common.properties
<ALF_HOME>\tomcat\webapps\share\WEB-INF\classes\alfresco\messages
common.properties\slingshot.properties
We need to edit the \tomcat\webapps\share\WEB-INF\classes\alfresco\messages\common.properties as well as \tomcat\webapps\share\WEB-INF\classes\alfresco\messages\common_en.properties the second file the locale specific file should also be modified.
Modify the below key's value
date-format.default=mm/dd/yyyy
These changes only impact the display format of date, if we need to make changes for form we need to modify in \tomcat\shared\classes\alfresco\web-extension\site-webscripts\org\alfresco\components\form**form.get_en.properties** and form.get.properties.
Hope this will help you :)
I've read a many things about parsing date in obj-c, but I can't find anything dealing with dates like "Mon, 25 Apr 2011 11:53 am CDT"... I'd like to convert it to NSDate in a smart way but I'm running out of ideas.
Thanks.
-[NSDateFormatter dateFromString:]
You'd probably use #"EEE, d MMM yyyy hh:mm a zzz" as your date format string.
And by the way, googling "convert string to date objective-c" yields thousands of hits that have correct answers.
NSDateFormatter is a pretty complete class that covers all "human-friendly" date scenarios.
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSDateFormatter_Class/Reference/Reference.html
There's also several questions on stackoverflow that seem very similar to your question, so a quick search should help you out.
after selecting the date from the date picker, i am getting the date in the format in view like yy/mm/dd .
i want to the date format in my view like mm/dd/yy.
how can i do this.
You can use the following snippet to convert the date to the format you desire. Note that month use uppercase 'MM' in the format:
[dateFormatter setDateFormat:#"MM/dd/yy"];
dateString = [dateFormatter stringFromDate:theDate];
For a full list of the formats available, have a look at the Unicode Standard. With a few minor exceptions, these formats are all supported on the iPhone.
I have this date and time format:
2010-05-19 07:53:30
and would like to change it to:
Wednesday # 7:53PM 5/19/2010
I'm doing this, which gets the current format:
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = #"yyyy-MM-dd HH:mm:ss";
but when I change the format, I end up with a null. For example:
formatter.dateFormat = #"hh:mm tt MM-dd-yyyy";
date = [formatter stringFromDate:formattedDate];
date will be null. I want to put the end result into an NSString. It would be nice if time and date could come out as separate properties so I can arrange them however I like. Any ideas on how I can change the formatting?
I think your formatting string is the problem. You should only use the characters you find in the table in UTS#35 Date Format Patterns. I tried your code and while the time hh:mm displays correctly, formatting stops at tt - not in the table!
If you really want characters in the format string that are not in the table you can escape them, like hh 'o''clock' a, zzzz - produces format like "12 o'clock PM, Pacific Daylight Time".
It would be nice if time and date could come out as separate properties so I can arrange them however I like. Any ideas on how I can change the formatting?
You have things backwards. If this is a date/time to be displayed to the user, you need to present it how the user wants it, not how you want it. For instance, most people outside the USA will be confused by MM-dd-yyyy particularly if the day is less than 13. Consider using -setDateStyle: and -setTimeStyle:. That way, the display string will come out as the user expects.