FAQ Database Discussion Community

date time to date (Y/m/d)

I have this as my date if I use $patient['DATE_UNIT_ADM'] just as. 28/07/2012 00:00:00 but when I do this to get it to a Y/m/d format it goes back to 1970/01/01 $timestamp = strtotime($patient['DATE_UNIT_ADM']); $AdmissionDate = date('Y/m/d', $patient['DATE_UNIT_ADM']); Why is this. Whats happening in strtotime? UPDATE. there is still something...

Dojo Date Parse not parsing date

The date string I'm trying to parse: 7/15/2014, 3:26 PM UTC The date pattern I think should be working: 'MM/dd/YYYY, h:m a vz' Question: am I doing something wrong? Link to the format options here: http://dojotoolkit.org/reference-guide/1.10/dojo/date/locale/format.html I'm using it like so: var date = locale.parse('7/15/2014, 3:26 PM UTC', {datePattern: 'MM/dd/YYYY,...

Format string with date by javascript to another format

I have string in this format: var date = "2012-02-12"; I would like return the date in this format: 12.2.2012 What is the easiest way for this? I was trying var date = new Date( "2012-02-12" ).format("dd.m.yy"); but its returning error undefined is not a function....

Convert String into Date java [duplicate]

This question already has an answer here: java does not parse for 'M dd, yyyy' date format 4 answers import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; public class DateFormatter { public static void main(String[] args) throws ParseException { String testString = "14 September 11"; DateFormat df = new...

How to get system time format when region is “United Kingdom” in ios?

I am using the following code for get system time format in ios. And it work fine when my current region set with "United State" but when I change the region from "United State" to "United Kingdom" it always give 12 hour formate. #pragma mark #pragma mark - get system...

How to convert asp.net json date format to DD-MM in javascript

Hi i need help in converting data-time format. I'm using Cordova and JqueryMobile, my web services are in asp.net. In response of my Ajax call i get date in the format below. "/Date(1425935535000+0000)/" I need to convert it to DD-MMM format (i.e 13-Mar ) what utility i use to convert...

What date/time format is this? COBOL Output

I seem to have an issue figuring out what date format a program in COBOL is storing data in. DATE_SCHD A80911 A80911 B00324 A51021 A51028 A60518 B50204 B50204 B50204 B50204 B50206 B50202 B50206 B50210 Any clues?...

Group by date using proc sql in SAS

I want to sum up all values for the same cost centre per each year in SAS. I tried with Group By function in Proc SQL. PROC SQL CREATE TABLE incident_data AS SELECT Cost_Centre_Dim.Cost_Centre_Name, Sum(Count*Amount) AS TOT, OCC_DATE format= Year4. FROM Incidents, Incident_Type, Cost_Centre_Dim WHERE Incidents.Incident_Code = Incident_Type.Incident_Code AND Incidents.Cost_Centre_ID...

Multiple date formats in MATLAB [closed]

When formatting datetimes, datestrings and datenums in MATLAB there are two different ways in which minutes and months are represented, either as M and m or m and M respectively. Concretely, when you use when you use datestr it is different to when you use datetime. Here is an example,...

NSDateformatter: How to decide date formatter string

Is there any rule to define date formatter? I have date string as given below Mon Feb 10 09:05:13 PST 2014 How to do i write appropriate date format for this date string to convert date? NSDateFormatter * dateFormatter = [[NSDateFormatter alloc]init]; [dateFormatter setDateFormat:@"EEE-MMM-DD-hh:mm:ss-Z-YYYY"]; NSDate * dateFormatted = [dateFormatter dateFromString:date];...

How to serialize a custom formatted time to/from xml in Go?

When serializing a datetime to/from xml how do I make it use a custom time format?

Formatting dates in PostgreSQL

I have a field which its format is date with time as: YYYY-MM-DD HH-MM-SS for example: 2000-08-12 00:00:00 I want to get just the date part and change its format to DD/MMM/YYYY for example the expected result of the previous example will be: 12/Aug/2000 The field definition is: Ddate timestamp...

want to convert 01:30 PM to 13:30

I work with PHP and I got time like 11:00 Am,1:00 PM. But I want to convert that time into 24 hours format. example: 10:00 AM => 10:00 2:30 PM => 14:30 ...

PHP date conversion using strtotime

I have a date in the ymd format. Example for 2014-05-28 I actually have: 140528. I would like to convert it to the date(c") format. Example: 2014-05-28T00:00:00-04:00 I cannot use DateTime::createFromFormat because of my php version. So instead I tried strtotime, but with no success: $d[14]="140528"; $deliveryDate = date('ymd', $d[14]);...

Parsing String into a Calendar object

I am having trouble parsing a string which contains ONLY the MONTH and DAY information into a date object. Looking through other threads I decided to use SimpleDateFormatter. Here is my code: void checkDay(Calendar now) { Calendar cal = Calendar.getInstance(now.getTimeZone()); for (String holiday : usHolidayList) { Date holidayDate = null;...

PDF date field - one format, multiple valid inputs

I need to create a PDF with a date field that displays dates in the format dd.mm.yyyy. This field must be validated and should also accept inputs in other formats. For example, users should be able to input dates in the form dd.mm.yy, which will then be expanded to dd.mm.20yy...

sql query date formating (Hours:Min)

How to display values as hours:Minutes format (eg 77 , Result: 1:17) info : select SUM([Travel Time] + [Total Productive Time]) from vAction_Reg where incident_id = '10064068' Result: 77.00 Need to get result in below format (1:17) Changed Query: SELECT(SELECT ISNULL(SUM(action.service_time), 0) AS Expr1 FROM dbo.act_reg AS action INNER JOIN...

What number formats would to_number(to_char(sysdate, 'ydddhh24mi')) produce?

We're transferring a legacy Oracle SQL application to a new platform and I cannot locate proper date format documentation. What type of numbers would be produced by SELECT to_number(to_char(sysdate, 'ydddhh24mi')) FROM dual if sysdate were January 3, 2015 at 6:04 AM December 23, 2000 at 4:17 PM ...

How to update/Change the date format to MM/dd/yyyy from dd/MM/yyyy format in sql server?

In my db DOB is saved in dd/mm/yyyy format. i want to change the DOB date format to MM/dd/yyyy. How can i do that?

Grails: How to format date in language set in locale?

My multi-language Grails-based website has a switch for locale. I'd like to make sure date values are displayed in the locale set (and in the format currently being used in other outputs of scaffolding as the site is already available to the customer). Here's an example code I'm using: <g:formatDate...

How to convert date into “2015-05-14T23:00:00” format - Jquery

I'm trying to convert a date string into the above format: var today = new Date(); today.getDate() - 7; //gives me 14 - considering today is May21 data['startDate'] = today.getDate() - 7; //now data['startDate'] = 14; how can i convert this 14 into 2015-05-14T23:00:00format?? thanks!...