datetime

How to convert DateTime value C# into something like 31st January 2009 but in Polish Language?

Hello, How to convert DateTime.Now (or basically any other DateTime format) to something like 31st January 2009 (although i would like it in polish so i need 29 Styczeń 2009). Do i need to create some array and check each month number with that array or there's some built in feature to save the day? With regards, MadBoy ...

How can I convert a java.util.Date object to the restricted form of the canonical representation of dateTime

I need to convert a java.util.Date variable to a representation similar to the one below. 1995-12-31T23:59:59.999Z The format for this date field is of the form 1995-12-31T23:59:59Z, and is a more restricted form of the canonical representation of dateTime http://www.w3.org/TR/xmlschema-2/#dateTime The trailing "Z" designates UTC t...

Is this a php bug, or is something wrong with my timezone/PHP settings?

The real, full contents of the file: <?php error_reporting(E_ALL); ini_set(display_errors, 'on'); try { //$x = strtotime('blah'); $x = new DateTime('lol'); } catch ( Exception $e ) { echo $e->getMessage(); } The DateTime constructor accepts a string, which should throw an exception if it can't parse it. This runs f...

Convert month string to integer in java

Given a month string such as: "Feb" or "February" Is there any core java or third party library functionality that would allow you to convert this string to the corresponding month number in a locale agnostic way? ...

Groovy Sql and SimpleDateFormat help

In my database, I have a column type : datetime. Column data example : 2009-02-03 19:04:23.0 I'm using : SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S"); to define my date format. I'm using groovySQL to read tables and for each rows, I'm adding a new SampleJ object (mapped to a new table - SampleJ). Here my...

Android alarm manager

Hi i've been researching the alarm manager in android and was wondering if there how to set a specific time for an alarm (or could use notification manager)to go off at a specific time for example 12pm tomorrow . The code below sets the alarm for 5 seconds from now so to set it for something like 12 pm could you do something like 12:00:...

Validation for Date

Hi, I have one web application, in this i have to validate one date field of format like mm/dd/yyyy. I searched in the net but i didn't get the proper one. Please help me by providing the new function or by correcting on my code. My code is shown below.. I had called this JS function at onblur event.. function isValidDate() { var re = ...

How to convert a byte[] into datetime in C#?

I have a field of type TimeStamp in database, which is converted in byte[] in c# code, and i need to convert it to DateTime value. So i want to convert from an array of bytes into DateTime. Already used this code: byte[] byteValue = someValue; long longVar = BitConverter.ToInt64(byteValue); DateTime dateTimeVar = DateTime.FromBinary(lo...

PHP, Codeigniter: How to Set Date/Time based on users timezone/location globally in a web app?

Hello all, I have just realised if I add a particular record to my MySQL database - it will have a date/time of the server and not the particular user and where they are located which means my search function by date is useless! As they will not be able to search by when they have added it in their timezone rather when it was added in t...

In C#, convert Sql Server 2005 datetime value to another timezone

UPDATE I am dealing with a legacy database where the datetime values have been stored in a specific timezone (not UTC). Assume it is not possible to change how we are storing these values. END UPDATE Say I have a SQL Server 2005 database with a table as follows: [id] (int) not null [create_date] (datetime) not null Suppose my [c...

Getting UTC offset for a datetime

I have tried this but its not correct: In [34]: e_now Out[34]: datetime.datetime(2010, 2, 17, 0, 2, 40, 506444, tzinfo=<DstTzInfo 'US/Eastern' EST-1 day, 19:00:00 STD>) In [35]: e_now.utcoffset() Out[35]: datetime.timedelta(-1, 68400) ...

Using query to retreive records which their createdate is a special date?

I have a table that has four columns. One of them is named "CreateDate" and it's datatype is "DateTime". Now, what would be a true T-SQL which retreives records that their CreateDate is for example "2010-02-10" ? ...

Find format used to parse date into string

DateTime date = new DateTime(1970, 1, 15); string sdate = date.ToString(value_i_will_forget as string, CultureInfo.InvariantCulture); // some lines later string format_string = MagicParse(sdate, CultureInfo.InvariantCulture); I have an arbitrary date that I write to a string with CulturInfo.InvariantCulture. The .Net format I...

Trying to create an array of DateTime objects -- Datetime[]

My brain doesn't seem to be working today. I googled around for this and just couldn't find it, which seems kind of strange since this is such a basic question that I can typically find out very quickly. I'm trying to create an array of DateTime objects. I can't use a List. DateTime[] dates dates[0] = Convert.ToDateTi...

Converting timezone offset to friendly name in PHP

I'm trying to convert a RFC timestamp to a friendly date using PHP. Here's the example: Wed, 17 Feb 2010 19:44:01 -0500 I'd like this to print as: Wed, 17 Feb 2010 19:44:01 EST Using date() + strtotime() doesn't seem to do the trick because it converts it to the server's timezone (in my case PST). Is there a simple way to do this ...

User selects something in combobox, something else is sent to dependency property

In my application the user can select how a date is displayed. Most of the standard datetime format strings can be selected. My problem now is that the average user doesnt understand the difference between "m" and "D". What I want to do is change this so that, as excel does, rather than showing the format string, I show how an arbitrary ...

How to filter a table by T_SQL in SQL Server 2005, using a specific time for a column of "DateTime" datatype

hi How to filter a table by T_SQL in SQL Server 2005, using a specific time for a column of "DateTime" datatype? Thank you ...

First weekday on android phones

Hi! According to Androids documentation I get the impression, that Android only supports ISO 8601 week number calculation (this is good for me as I live in Austria). So, I think that an "Android Week" alway starts on Monday. This is important for me, because I want to read/write Androids calendar and the recurrence rules are encoded wi...

originally Creation Date of a Document

hello, i have a file with documents. i wrote a applikation with asp.net. i need to read the creation date and the date of the last change (and title, etc.) for that i used the API filesysteminfo. in the file are documents, that are a copy of a vss server. but when a document is copied, the date of creation changes to the "date of copy...

How do I format date literals in dynamic linq?

I am using dynamic Linq to return data for user-input search criteria. My query is working fine except for the user selected dates. My current code is: StringBuilder whereClause = new StringBuilder(); if (startDate.HasValue || endDate.HasValue) { DateTime searchStartDate = startDate.HasValue ? star...