datetime

how to tell convert.todatetime that the input is in format dd-mm-yyyy

have written a code, that is supposed to take time and date input from the user and convert it to datetime format add some value to hrs and display it. works fine, when user gives input in the default format. but what is user enters like dd-mm-yyyy instead of mm/dd/yyyy(default) how to tel the convert function to take care of this...

Time zone conversion in C#

I have a date format, something similar to: Mon, 11 Aug 2009 13:15:10 GMT How do I convert this to EST format? ...

Extracting date from String

I'd like to extract a date from any string entered. But not specific to a date format (otherwise I'd use some sort of regex) e.g "Pictures taken in Africa 3 weeks ago" The php parser would extrace "3 weeks ago" and I can happily convert this. Does anyone know of the best method to perform this or of any library that can do it for me...

How do I check if an Excel cell's Date is within one week?

I'm using VBA in Excel 2010 to make a simple birthday reminder program. I have a column of dates (Column D). How do I check if a cell is within one week of today? I'm not sure what the VBA syntax for the conditional statement would be: For i = 2 To MAX_ROW cell = ActiveSheet.Cells(i, 4) If (Date(cell) - Date(Now()) <= 7) Then ...

XQuery conversion for date to dateTime

Hello, I have a variable parameter that is formatted to the date type in XML. I need to convert that parameter into the dateTime format for another variable to accept my copy operation. This is being done in BPEL, but the expression builder for XQuery should be the same regardless of the processing language. Thanks very much for any h...

Does grails / hibernate store Dates with miliseconds in PostgreSQL?

I'm currently using grails with classes storing java.util.Date fields als DATETIME. However I need the precision / miliseconds to be stored as well which I think is not possible with MySQL. If I switch to PostgreSQL, will it store my Dates with milisecond precision (or is it easy to configure it this way)? ...

Change timezone in C#

I have a date format, something similar to: Mon, Sun, 22 Aug 2010 12:38:33 GMT How do I convert this to EST format? Note: I know it can be achieved using TimeZoneinfo, but that is introduced in 3.5, i want to do it 2.0 or any old version. ...

C++ library (unix) to parse date/time string Including timezones

I have dates in a bunch of formats. Now i would like to have a function (from some library) in c++ that can parse these date/time string and give me some structure like a tm or convert them to some deterministic representation so that i can play around with the date/time. Some formats that I see are as follows : Tue, 19 Feb 2008 20:47:...

What control for date picking is good for MVC2?

What control can I use to select dates for ASP.Net MVC2? ...

javascript, jquery time format

Hi everybody , I have a question, how can I change time from 24hr format to 12, the easiest way, in javascript or Jquery . This is what I have : TempDate = $.datepicker.formatDate('MM dd, yy', TempDate); var ChangeDate = TempDate + " " + TradeTime; now TradeTime= 15:59 , but I wanna be 3:59PM What is the easiest way , or can I...

MySQL: Strange result when subtracting Date value and NOW()

I just tried to insert two rows with the current datetime and then calculated the elapsed time since that date. Here are the rows from my table after two insertions and using NOW() function to set the timestamp: mysql> select * from pendingActivations; +--------+------------+---------------------+ | userId | code | timestamp ...

ASP.net SQL server universal date problem.

I need to solve the following problem for one of my clients. They have an installer which installs a SQL server database + IIS website. The SQL database user can have any kind of date format (DD/MM/YYYY, MM/DD/YYYY,...) depending on the locale of the sql server. The IIS website can have any kind of date format (can be different from sql...

Parse Simple DateTime

DateTime dt = DateTime.ParseExact("1122010", "Mddyyyy", System.Globalization.CultureInfo.CurrentCulture); Throwing this exception: String was not recognized as a valid DateTime. I'm sure it's the lack of a leading 0 in the month. What's the correct format string? ...

Invariant dates with WCF RIA Services

Hi Is there any way to prevent Silverlight/RIA Services from converting a datetime object on the wire? Right now, I see datetimes set to 'Local' or 'Unspecified' being converted to the local time of the server when they are sent over the wire. For example: The client and server are both in UTC -04:00:00. I use DateTime.Today (kind ...

Custom classes in python: does a method HAVE to be called with an instance?

I'm processing data from an application that has a few quirks in how it keeps time. One of the simpler quirks is that it uses "day of year" (Jan 1 is 1, Febuary 1 is 32, etc) instead of month + day. So I want to make my own date class that inherits from the default datetime class and has a few custom methods. I'm calling this daytime. In...

How to convert a date of integers to a formated date string (i.e. 2012009 to 2/01/2009)

Any ideas? I can't come up with any. I have a list of dates I'm loading in from a csv file and they are saved as all integers, or rather a string of integers (i.e. Jan 1, 2009 = 1012009) Any ideas on how to turn 1012009 into 1/01/2009? Thanks! ...

How to convert apache log time to activerecord :datetime

I'd like to save apache logs to MySQL via ActiveRecord. In the apache log, the default time string is like: [13/Aug/2008:00:50:49 -0700] How can I convert it to a ActiveRecord :datetime type? Thanks! ...

How to create a .Net DateTime from ISO 8601 format

I've found how to turn a DateTime into an ISO 8601 format, but nothing on how to do the reverse in C#. I have '2010-08-20T15:00:00Z' and I want to turn it into a DateTime object. I could separate the parts of the string myself, but that seems like a lot of work for something that is already an international standard. ...

Adding value to Time Stamp

Hi Guys, I am trying to create a script for quiz. I have stored current time stamp in mysql DB as quiz start time, and want to check after each quiz how much time is left. I have the idea that I will add 30 mins to saved time stamp and subtract this value from current time. That will be the time left. But I don't know the exact way of...

Recommended date format for REST API

Hi - I'm writing a app that exposes a REST API. Some of the query parameters will be date/time (accurate to second), and some of the responses will be timestamps (accurate to millisecond). The API implementation on the server is in Java. The client apps can be anything - java, javascript, .NET. The API returns XML or JSON data. Date/T...