date-format

How can I remotely (via web services) determine date format of SharePoint 2003 site, for use in Versions.asmx returned XML?

The GetVersions() call to the Versions.asmx web service in SharePoint 2003 returns a localised date format, with no way of determining what the format is. It's the site regional setting of date format, but I can't find a way to get even that out of SharePoint 2003. Locally, it looks like SPRegionalSettings can be used (http://msdn.micros...

SQL date format issue in select query

I have an ASP page which will fetch records from a SQL server DB table. The table "order_master" has a field called order_date. I want to frame a select query to fetch order date > a date entered by user(ex : 07/01/2008) I tried with convert and cast, but both are not working. The sample data in order_date column is 4/10/2008 8:27:41 PM...

What is the best way to parse a date in MM/DD/YY format and adjust it to the current / previous century?

One of our customers wants to be able to enter a date with only 2 digits for the year component. The date will be in the past, so we want it to work for the previous century if the 2 digit year is after the current year, but work for the current century if the 2 digit year is equal to or less than the current year. as of today 10/30/200...

How do you globally set the date format in ASP.NET?

How do you globally set the date format in ASP.NET? My local machine and servers have Regional Settings set to "English (New Zealand)". When I format a date with "dd/MM/yyyy" I expect to see "19/11/2008" for today for example. Until recently, that is what I did in fact get from both my local machine and the servers. Just recently, fo...

How do I trim date in PLSQL?

I have a date variable as 24-dec-08 I want only the 08 component from it. How do I do it in a select statement? e.g.: select db||sysdate (this is the component where I want only 08 from the date) from gct; How do i do it? ...

I need to change the date format using php.

Hi I have looked at a question already posted about this and tried to adapt my code to do a simlar thing. Basicly I have a field in my mysql database that has the date in this format yyyy-dd-mm i need to the format to be dd-mm-yyyy. Currently my code is getting stuck on the line echo "<td><strong> ("d/m/y",". $row['date'] .")</strong></t...

Displaying proper date format depending on culture.

I am using a control for a popup calendar date picker. This uses a javascript function, SetText, to set the textbox to the given date. I can't change anything in the calendar control itself but I can override the SetText function. The SetText javascript just takes the TextBox name and the date value in string format and sets the TextB...

Proper DateTime Format for a Web Service

I have a webservice with a method which is called via a xmlhttprequest object in my javascript. The method accepts a datetime parameter which is subsequently converted to a string and run against the database to perform a calculation. I get the value from m_txtDateAdd and send off the xmlHttprequest <asp:textbox id=m_txtDateAdd tabInde...

php/mysql - date_format and the time portion

Apologies if this has already been answered many times, but I was unable to find the answer and I was flummoxed. I have a mysql query which seemingly outputs the result I want when I run it in the database - however when I run the query through PHP, it does not output correctly. In the database, dates are stored like this: 2009-08-13T...

How to optimize mysql date_format() for speed in where clause?

Hi guys, I'm trying to optimize relatively big mysql (myisam) table with 220,000 rows. The table itself is not so big - about 23.5MB in size. So, what's the real problem? - i got query like this: SELECT * FROM table WHERE DATE_FORMAT(date_field, '%m%d') = '1128' LIMIT 10 I tried to set an index on date_field but EXPLAIN show that the ...

MySQL/PHP update query with dates not updating

Bit of a strange problem here... I've got an update query that isn't working, and I can't for the life of me work out why! My table has two three fields - 'id' (int, auto increment), 'date' (date), and 'amountraised' (decimal). Part of the app I'm developing calculates the fundraising total each week made by a charity bookstall. The 'd...

Groovy date formatting problem

Hi! I am developing a groovy application and I am having problems when showing a Date field. If I use the following notation: <g:formatDate format="dd.MM.yyyy" date="${fieldValue(bean: incidentTicketSLAInstance, field: "erstellungsDatum")}"/> I am getting the actual date instead of what is saved at the DB. When I use this notation i...

Can I alter DateFormat.SHORT to include seconds or something similar?

Hi, In my application I am using code like this: DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, locale); df.setTimeZone(User.getTimeZone()); String s = df.format(d); to format dates in an application that is used across different locales. I'd like to, sometimes, add seconds to this but I don't wan...

Parsing dates to a Rails friendly format

I've got a batch of a 100k or so records that I'm importing to a Rails app. There's a date in each row formatted like the following: 03/17/81 However, when I try to just assign it to a date field, it gets converted as follows: ruby-1.8.7-p174 > "03/17/81".to_date => Sat, 17 Mar 0081 Ultimately I would like the format to result in ...

Sharepoint 2007 calculated Date field shows incorrectly in non-US region

If a SharePoint user (with Regional Settings set to UK) views a calculated date field in a View details form, the field shows incorrectly. I am using: ddwrt:FormatDateTime(string(@RenewalDate), 1033, 'dd MMMM yyyy') Which shows 04 January 2010 for 01/04/2010 and, doesnt show unresolvable dates such as 31-Dec-2010. This applies even ...

ActiveRecord date format

I've run into a spot of bother with date formats in our Rails application. I have a date field in our view which I want to be formatted as dd/mm/yy. This is how the user will expect to enter their dates, and the datepicker control uses this format. However, Active Record seems to be expecting mm/dd/yy. If I enter 01/03/2010, this get...

Using EXSLT to subtract dates

How can I use EXSLT extensions to subtract a date. I see that there is a date-add function, but the EXSLT docs don't include any examples. I am trying to take the current date and subtract 1 month for example. ...

PHP - Converting a string into various date formats

Hi I am new to PHP and cannot figure out the best method to convert two strings I have from URL params. I would like to convert: "August 2010" to ---> "2010-08-%" and also: "2010" to ---> "2010-%-%" Thank you in advance! ...

Problem with date formats in JavaScript with different browsers

Hi, I am working with dates in an RSS feed, but am finding differing results when using the code below in IE, Chrome and Firefox: new Date('2001-01-01T12:00:00Z') Firefox is happy with that, but Chrome and IE return Invalid Date. I thought I'd try replacing the T and Z as follows: new Date('2001-01-01 12:00:00') This time Chrome ...