I'm using Boost's datetime library in my project. I was very happy when I discovered that it has time duration types for hours, days, months, years, etc, and they change their value based on what you're adding them to (i.e. adding 1 month advances the month part of the date, it doesn't just add 30 days or somesuch). I thought this prop...
Hi
How do i get the year(2009) and month(12) from the string datetime, following give me correct full date but wrong year (1905-07-03 00:00:00.000) and month (1900-01-13 00:00:00.000). I have tried changing YYYY to year and MM to month.
Declare @date dateTime;
Declare @CurrentYear datetime;
Declare @CurrentMonth datetime;
Select @date ...
Question in short:
How tot do this in MVC.NET?
Question in long version:
Im trying to use a DateTime column in a SQL Table for version tracking (this in itself is proposed as a solution to re-attaching a Linq2Sql data class after being passedback by a editview for the table)
But now i get 'row not found or changed'-exception. on the ...
I have a problem.
I have an application in C# with SQL SERVER 2005 as backend.
The problem is in fetching the correct record based on the date.
The frontend code is
if (string.IsNullOrEmpty(txtFromDate.Text))
SelectCmd.Parameters[0].Value = DBNull.Value;
else
SelectCmd.Parameters[0].Value = txtFromDate.Text;
Now if I ru...
If I get the RFC-1123 formatted date of a DateTime object, it gives the current local time, but gives the timezone as GMT (which is inaccurate).
DateTime.Now.ToString("r");
returns
Fri, 12 Feb 2010 16:23:03 GMT
At 4:23 in the afternoon, but my timezone is UTC+10 (plus, we're currently observing daylight saving time).
Now, I can get a r...
i know using datetime.timedelta i can get the date of some days away form given date
daysafter = datetime.date.today() + datetime.timedelta(days=5)
but seems no datetime.timedelta(months=1)
!Thanks for any help!
...
hi ,
I want to convert this date ( 02-12-2010) mm-dd-yyyy to time format
ie
to 02-12-2010 0 hours 0 minutes and 0 seconds
i have user time and date functions but when i refresh the page its value is changing as per the time.
i need that to be fixed
also i want to convert this date (01-24-2009) to time format.
please help me
Tha...
I know this might sound a silly question, but I did not find in PHP documentation somewhere were they state loud and clear this one.
I have got a web application.
Users of my web appliations are in Europe, but the server running the web appliation is in US.
How should I set the date.timezone php ini directive???
I suppose to where th...
I want to use Data Annotations to validate DateTime fields, but I'm running into problems. According to documentation on MSDN, the following should do the job
[Range(typeof(DateTime), "1/2/2004", "3/4/2004",
ErrorMessage = "Value for {0} must be between {1} and {2}")]
However, this marks any date I enter as invalid!
At first I th...
We're currently using a 3rd party API that provides datetime in the following format:
Sat Mar 06 09:00:00 ICST 2010
Fri Feb 19 19:30:00 JDT 2010
Fri Feb 19 19:30:00 PST 2010
However, we want to store these datetime objects in MySQL in a standard datetime field which requires the following format:
YYYY-MM-DD HH:MM:SS
Right now we're...
Does anyone know of a library (paid or not) out there that is able to handle more common datetime formats than DateTime.Parse uses? Something that can handle multiple languages and abbreviations for days/months would be really nice.
For example: "Sept 1, 2009" does not work with Datetime.Parse.
...
I've often standardized on YYYY-MM-DD as the date format for communicating within a geographically distributed project teams to dispel any ambiguity that might arise from local date formats. Is it likely that I might run into people who are used to seeing dates as YYYY-DD-MM? Are there programs that use this as a date format?
...
Hi All,
Thanks for looking at my question.
I am looking to have a London information bar on a website. Something that will show the following information:
London, England: 9:27PM Friday 12 February 10°C/50°F
Can anyone please help?
Thanks :)
TO LET ALL KNOW, I DO JUST WANT IT FOR LONDON. NO MATTER WHERE YOU ARE VIEWING IT FROM. NO...
I have a column which is a Timestamp.
It records something like: 2010-02-08 12:10:22
Then I use this in php:
$postdate = date( "j F", strtotime( $row['modify_date'] ) );
And it can output something like: 8 February
My Q is, how can I change the date-text so it outputs the month name in another language (swedish specifically)?
Ex:...
Hi,
we're writing a scientific tool with MySQL support. The problem is, we need microsecond precision for our datetime fields, which MySQL doesn't currently support. I see at least two workarounds here:
Using a decimal() column type, with integer part corresponding to seconds since some point in time (I doubt that UNIX epoch will do, ...
I have this to select a date from a mysql db, and compare it to an array of month-names in swedish language.
$monthnames = array("","Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December");
$postdate = $monthnames[date("n", strtotime( $row['modify_date'] ))];
//Outputs something lik...
I'm trying to format some dates in PHP (i'm a Coldfusion programmer, so the syntax is similar, but i'm stuck!).
The dates are formatting perfectly into the display I want. However, they all return 1st Jan 1970.
Can anyone shed any light on this?
For background, I am pulling a date from a datetime column in mySQL. The raw date i'm tryi...
This sounds simple enough but I haven't been able to figure out how to use a simple SELECT statement to return the current time in GMT.
I have been trying to use CONVERT_TZ() to convert NOW() to GMT based on the server time zone and the GMT time zone but for some reason it returns NULL when I put in the text time zones. The only way I g...
Im trying to incorporate jQuery plugin FullCalendar into my application.
All was going well until i decided to implement the dropping of a calendar event in the calendar. for this i hooked up the following code to the eventDrop eventhandler (jquery / clientside)
eventDrop: function( event, dayDelta, minuteDelta, allDay, re...
I have a bunch of date data in a mysql table like this:
2010-02-13 1:00:00, "soma data"
2010-02-13 1:25:00, "soma data"
2010-02-13 1:37:00, "soma data"
2010-02-13 2:12:00, "soma data"
I want to select a report which shows the data grouped by hour, for example:
On Feb 13, during the hour from 1:00 pm to 1:59 pm, there were 3 data poin...