datetime

Date vs Milliseconds | for scalablility, saving, searching and obtaining time in Java + MySQL(or other Db's)

Which is the most beneficial in Java and a DB for DateTime? (Using JodaTime as Date) (DateTime object (Java) + TIMESTAMP (DB) ) VS (Milliseconds long (Java) + BIGINT(DB) for the use of DateTime information in Java Web application backed by an underlying Database Areas of interest manipulating, processing and memory usage in Java s...

Net DateTime.AddMonths(1) doesn't work the same as Javascript d.setMonth(d.getMonth() + 1)

I have client side date validation that requires one particular Date to be one month from a different date so I use d.setMonth(d.getMonth() + 1) and mostly works just fine. For end of month issues as in 1/31/2009, it returns 3/3/2009 and that's great - that's how I'd prefer it handle it. In the code behind, I'm also generating this d...

DateTime.Parse for pubDate in RSS Feeds

I'm trying to pull a DateTime object from RSS feeds in C# and DateTime.Parse(string) was working fine for the BBC rss feed which has a format like: Thu, 24 Sep 2009 13:08:30 GMT But when I try and use that for Engadget's feed which has a date format like Thu, 24 Sep 2009 17:04:00 EST throws a FormatException. Is there something straigh...

MS SQL Join on dateTime

Hi I have a query that joins two tables. The join is done on several columns, including a dateTime column. The problem that I have at the moment is that the one dateTime column stores milliseconds whereas the other table is populated from a file which does not contain milliseconds Because of this the join will never return results. Is t...

C# How to parse a string of date in an arbitrary specified Oracle date format?

How to parse a string of date in an arbitrary specified Oracle date format in C#? So... the oracle format string is a bit different from the C# datetime format string, so I can't use that format-string as an argument for the parse. I am using Devart/CoreLab but their OracleDate.Parse seems to be really strange and not working for me. H...

WordPress Post Date Changes On Update

Hi all, I have my permalinks in WordPress set to the Month and Name setting. This generates URLs like /blog/2009/09/my-post-name. Every time a post is updated, it changes the posting date, which can potentially change the permalink address. This is wreaking some havoc on my site, as I'll have banner/button ads throughout that point to ...

datetime function in php

I want to store the data and time in my MYSQL db.I have a datetime field in my db I want to store current datatime in my db How shold i get the current date time?How to pass it to db via a sql query How can i then retriev an print it in correct yyyy--dd--mm format or any other format What wil be format of time? wil it be 23 hrs etc? H...

MySQL query to copy date from different columns

I have the following 6 integer db columns: Year Day Month Hour Minute Second I need a query that takes these values for every row, combines them into a DATETIME and puts into another column. ...

How to quickly produce a local datetime string in Haskell?

I'm looking for the best*est* way to produce the local time and date in string form, such as, for example: "2009-09-28-00-44-36.896200000000" I've been browsing Haskell's Data.Time docs, but I'm a bit stumped. (Big Haskell newbie here.) Thanks! ...

Drop Down Date Delivery

Hello, I want to use a asp.net drop down to present the user a delivery date on checkout. What I'm not sure about is how to get the specific dates. What the user should see and be able to select in the drop down is the next Monday and Tuesday for the next two weeks. Any help would be appreciated. thanks. ...

PHP: How to get Sunday and Saturday given a date input?

Hi Guys, How can I get the Sunday and Saturday of the week given a specific date? For example: input: Monday, September 28, 2009 output should be: Sunday, September 27, 2009 12:00 AM - Saturday, October 3, 2009 11:59 PM I am thinking of using the date, strtotime, mktime and time php functions. If you have a usable func...

Javascript: JSON Strigify changes time of date because of UTC!

Hi, can anyone help, my date object in javascript are always represented by UTC +2 because of where i am located. hence like this Mon Sep 28 10:00:00 UTC+0200 2009 Problem is doing a Json.stringify converts the above date to 2009-09-28T08:00:00Z (notice 2 hours missing i.e. 8 instead of 10) What i need is for the d...

Check if DateTime in DB is more than 90 days old via Stored Procedure

UPDATE Evidently I didn't include enough data, sorry! What I need to do is set 'campaign_Status' = 6 when 'campaign_Date' is more than 90 days old. Hi, I have a column (campaign_Date) which stores a DATETIME. Using a Stored Procedure I need to check if the stored date is 90 days old (or more). Any help would be great. Thanks. ...

How convert an String to an specific DateTime format in c#?

Hi, How to convert the string "28/09/2009" to DateTime in an specific format? Ex: I want to convert "2009-09-28 17:30:40" to DateTime. I want to convert "28/09/2009 17:30:40" to DateTime. I want to convert "20090928 17:30:40" to DateTime. There is multiples possible formats. I try this: string[] formats = new string[] {"yyyymmdd","y...

Alarm clock application in .Net

I'm not really writing an alarm clock application, but it will help to illustrate my question. Let's say that I have a method in my application, and I want this method to be called every hour on the hour (e.g. at 7:00 PM, 8:00 PM, 9:00 PM etc.). I could create a Timer and set its Interval to 3600000, but eventually this would drift out...

What Is The Optimal Way To Select Rows From Last 7 Days?

What's the best way to select only those rows from the table that have been created in last 7 days? There are dozens of time and date functions in MySQL and I'm a little bit confused about what's the easiest way to do this. For the sake of this question, assume that you have a table called "my_table" and it contains a row "created_at" ...

PHP get date as Unix Epoch time

I just got some tweets using their XML feed, and have gotten the date/times like so Tue Sep 29 22:30:51 +0000 2009 I tried using strtotime() on this, but it wasn't producing the correct results. I later on use echo date($dateTimeFormat, $twitterUnixTime); I know I could use a regex, but from the looks of it it will be complica...

What the best ways to use decimals and datetimes with protocol buffers?

I would like to find out what is the optimum way of storing some common data type that were not included in the list supported by protocol buffers. datetime (seconds precision) datetime (milliseconds precision) decimals with fixed precision decimals with variable precision lots of bool values (if you have lots of them it looks like you...

Using Now() as a default for MySql DateTime type

How can I setup a MySql schema with a DateTime column such that its value will always be the time of the last insert/update to this row? ...

Is there any easy way to increment a DateTime by monthly/yearly/daily units without having to parse it out like crazy?

I need to set up billing cycles and process payments. So for example I will process a payment immediately and then set the next one up to process exactly one month from then. So if I get DateTime.Now is there any quick way to just add a month to it? how about a year? Or will I need to parse it out into MM, YYYY, DD, and then add to MM, ...