datetime

Finding the date of monday in a week with VB.NET

I need to find a way to find the date (DD/MM/YYYY) of the Monday for any week we're on. For example, for this week, monday would be 09/11/2009, and if this were next week it'd be 16/11/2009. I managed to get somewhere in the forms of code, but all I got was 'cannot convert to Integer' errors. I was using Date.Today and AddDays(). Than...

How get datetime column in sqlite objecite-c

Hi, How do you get a datetime column in sqlite objective-c ? I have a table with 4 fields: pk, datetime, value1 and value 2. pk (primary key), value1 and value2 are integer so I am using: int value1 = sqlite3_column_int(statement, 2); int value1 = sqlite3_column_int(statement, 3); But what should I used for datetime? Thx ...

Formatting "yesterday's" date in python

Python I need to find "yesterday's" date in this format: MMDDYY So for instance, today's date would be represented like this: 111009 I can do this for today easy of course but having trouble doing it automatically for "yesterday" ...

Parsing Dates and Times from Strings using python

I'm using python, and want to parsing a string like "01-Jan-1995" to datetime type of python. who can tell me how to do it? thanks. ...

Possible latest Branch Merge Insert Datetime Bug

I ran into a bug with version 3.0.0.3 and the linq templates. The one where Update was a null object. So I downloaded the latest source for Subsonic.Core from git (merge branch from eibrahim Nov 3 2009). I built the source and am using the latest dll in my project. It has fixed the problem with running Update queries but now I have anoth...

Parse CIM_DateTime to .Net DateTime

My application is receiving some date information from WMI. This in the form of strings with the following format: yyyymmddHHMMSS.mmmmmmsUUU For more details on this format, see here. I'm interested in parsing everything before the period. I have the following code: string testDate = "20010701212212"; // July, 01, 2001 21:22:12...

How to properly add PyTZ to a Google App Engine application?

This is a little embarrassing, but I have not been able to find good resources on this topic. I'm working on a Google App Engine application that requires sophisticated time zone conversions. Since I am nowhere near the imposed quotas, I have opted to go with PyTZ. However, I must be doing something wrong. What I've done so far is: Do...

Check if string is of SortableDateTimePattern format

Hi, Is there any way I can easily check if a string conforms to the SortableDateTimePattern ("s"), or do I need to write a regular expression? I've got a form where users can input a copyright date (as a string), and these are the allowed formats: Year: YYYY (eg 1997) Year and month: YYYY-MM (eg 1997-07) Complete date: YYYY-MM-DD (e...

django datefield filter

I'd like to use an object filter similar to the following Shipment.objects.filter(date__gte=datetime.date(2005,1,1)) However there doesn't seem to be support for comparison operators on datetime objects. Is there a method I'm unaware of or should I look into writing a custom filter. ...

Compare only Date in nhibernate linq on a DateTime value

Hello, I trying to compare two dates (DateTime) in nhibernate linq: query = query.Where(l => (l.datCriacao.Date == dtLote.Date) but the error: NHibernate.QueryException: could not resolve property: datCriacao.Date of: SAGP.Entities.Lote anyone knows how I can solve this? tks ...

Joda Time to be included in Java 7?

I've read rumors that Joda Time is slated to be included in Java 7, but am having trouble locating a definitive source for this information. Will Joda Time be included in a future JDK? Please cite your source. ...

Converting asp.net/sql web app to be ime zone savy

Our current app stores all dates via the server's datetime. I'm thinking we need to update all datetime values in the database over to UTC time. Now for displaying these dates back to the user, I know .Net 3.5 has datatypes that are specific to date time offsets. But does anyone see anything wrong with setting an application variable...

date and time settings dont show up properly in wordpress 2.8.6

I have some problems while making my own theme for wordpress. Currently I'm making a comment system that was updated in wordpress 2.7 (you now that one with treated comments). I'm following the codex and everything is fine except the date-time output of each comment - now it is looking like this: %A %B %e%q, %Y at %I:%M %p . Instead of ...

NHibernate criteria datetime format issue

Hi I have a simple nHibernate criteria query which is looking for records with a datetime less than today: example: criteria.Add(Expression.Le("TheDate", DateTime.Today)); However, the results I am getting are incorrect when the day/month is ambiguous (eg 12th November 2009 returns the records for 11th December 2009) I have looked ...

System.DateTime? vs System.DateTime

Hi guys I was writing to some code where I needed to read the date value from a Calendar control in my page (Ajax toolkit: calendar extender). The code below: DateTime newSelectedDate = myCalendarExtender.SelectedDate; gives the following error: Cannot implicitly convert type 'System.DateTime?' to 'System.DateTime'. An explicit con...

Date format in SQL Server

Short Question: What's the best date format to use in SQL Server? Long Explanation: We're converting our database from mysql to SQL Server. In mysql we always used int(11) to avoid the daylight savings time issue, should we be doing the same in mysql (or is DATETIME good enough)? The use of the dates vary. Most of the time they're ...

how to convert weird varchar "time" to real time in mysql?

All, I have a time value being stored in a database as a varchar(4) and I need to convert it to real time. for example, if the time is "23:59" I want 11:59PM returned. The problem is that there is no ":" between the hours and minutes. So when I run this query SELECT TIME_FORMAT('2359', '%h:%i'); -- 12:23, wtf?? However if I...

Django auto_now and auto_now_add

For Django 1.1. I have this in my models.py: class User(models.Model): created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(auto_now=True) When updating a row I get : [Sun Nov 15 02:18:12 2009] [error] /home/ptarjan/projects/twitter-meme/django/db/backends/mysql/base.py:84: Warning: Column 'crea...

C# Date Parse Exact Issue

The following code produces an error, any ideas why? string dateFormatString = "dd.MM.yyyy HH:mm:ss"; string properDate = DateTime.ParseExact(DateTime.Now.ToString() , dateFormatString , null ).ToString() Error is: String is not recognised as a valid date and time. ...

Special Ocassion parser in JAVA

Hey guys, I am working on a date parser in Java. Just wanted some information on if there is any java library which could parse special occasions like for example if I give input as: Christmas or new year, it returns a date for this. Thanks in advance. Regards, Pranav ...