date-formatting
How do I format a date as ISO 8601 in moment.js?
moment().toISOString(); // or format() – see below http://momentjs.com/docs/#/displaying/as-iso-string/ Update Based on the answer: by @sennet and the comment by @dvlsg (see Fiddle) it should be noted that there is a difference between format and toISOString. Both are correct but the underlying process differs. toISOString converts to a Date object, sets to UTC then uses the … Read more
Compare two date formats in javascript/jquery
It’s quite simple: if(new Date(fit_start_time) <= new Date(fit_end_time)) {//compare end <=, not >= //your code here } Comparing 2 Date instances will work just fine. It’ll just call valueOf implicitly, coercing the Date instances to integers, which can be compared using all comparison operators. Well, to be 100% accurate: the Date instances will be coerced … Read more
PHP Fatal error: Call to a member function format() on boolean
Neither example work as you have multiple errors: You forgot your second parameter to Datetime::createFromFormat() h:i:s should be H:i:s Your date in the second example is separated by a . not a – Fixes: <?php $date = “13-06-2015 23:45:52”; echo DateTime::createFromFormat(‘d-m-Y H:i:s’, $date)->format(‘Y-m-d h:i:s’); $date = “10.06.2015 09:25:52”; echo DateTime::createFromFormat(‘d.m.Y H:i:s’, $date)->format(‘Y-m-d h:i:s’); ?>
Is there a date format to display the day of the week in java?
This should display ‘Tue’: new SimpleDateFormat(“EEE”).format(new Date()); This should display ‘Tuesday’: new SimpleDateFormat(“EEEE”).format(new Date()); This should display ‘T’: new SimpleDateFormat(“EEEEE”).format(new Date()); So your specific example would be: new SimpleDateFormat(“yyyy-MM-EEE”).format(new Date());
Format Date output in JSF
Use <f:convertDateTime>. You can nest this in any input and output component. Pattern rules are same as java.text.SimpleDateFormat. <h:outputText value=”#{someBean.dateField}” > <f:convertDateTime pattern=”dd.MM.yyyy HH:mm” /> </h:outputText>
Date formatting in WPF datagrid
Don`t forget to use DataGrid.Columns, all columns must be inside that collection. In my project I format date a little bit differently: <tk:DataGrid> <tk:DataGrid.Columns> <tk:DataGridTextColumn Binding=”{Binding StartDate, StringFormat=\{0:dd.MM.yy HH:mm:ss\}}” /> </tk:DataGrid.Columns> </tk:DataGrid> With AutoGenerateColumns you won`t be able to contol formatting as DataGird will add its own columns.
return date type with format in java [duplicate]
A Date is basically stored as a number of milliseconds since the epoch (1/1/1970). It can be formatted into a String in various ways (e.g. with SimpleDateFormat), but it is never stored as a String. So, what you’re asking for is impossible and makes no sense.
Is there a built-in function or plugin to handle date formatting in JavaScript?
No, there is nothing built-in for Dateobjects, but there are a bunch of libraries to deal with and format them: date.js moment.js XDate Date and Date.Extras in Mootools Date in Sugar Dojo.date a few functions in Mochikit DateFormat (only PHP’s date) date at php.js DataType in YUI, especially for i18n date-functions.js, used especially by JQuery … Read more