What is the easiest way to automatically fill a datetime column in an SQL data table with the date the row was created? Using SQL Server 2005 if that matters.
If my model for Items is:
class Item(models.Model):
name = models.CharField(max_length=500)
startDate = models.DateField("Start Date", unique="true")
endDate = models.DateField("End Date")
Each Item needs to have a unique date range. for example, if i create an Item that has a date range of June 1st to June 8th, how can I keep and Item with a date range of June 3rd to June 5th from being created (or render an error with template logic)?
I have html pages and I am parsing those pages with html agility pack.
Now I want to parse some information.In every pages there is trading date(20/02/02) which I want to parse.
Like it will be look like a Trading date : 20/02/02. Now Trading date and date(20/02/02) may be in same column(td) or it can be different column like in first column trading date and in second column 20/02/02 then what should I do ?
I am working on an ASP .net MVC application.
I have a System.DateTime? property say creationDate, which gets its value assigned from controller code. In my javascript I have access to this value, and I wanted to display this value in mm/dd/yyyy format in my grid. But I am not sure on how to convert System.Datetime? of c# to a javscript date or datestring value? Any help would be appreciated.
using simplexml to parse a feed, but I want to grab the date of the oldest item in the feed. Does anyone know how to do it? Thanks
$rss = simplexml_load_file("http://search.twitter.com/search.atom?lang=en&q=foobar&rpp=100&page=1");
Expiration Month
var month = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec");
for (var m=0; m" +month[m]+ "");
}
Expiration Year
var year = new Date();
var year2 = year.getFullYear();
for (y=0; y" +(year2+y)+ "");
document.write("");
}
hi
i try to run this query:
select * from WorkTbl
where ((Tdate = '20100414' AND Ttime = '06:00') and (Tdate <= '20100415' AND Ttime <= '06:00'))
i have this date: 14/04/2010 and time: 14:00
i cant see hem, how to fix the query ?
thank's in advance
My company is suffering some deployment issues, where we'd be greatly benefited if distributed source files were tagged with their current source control version, or the date/time they were checked in.
Is there a way in Visual Studio to do this automatically?
The following script returns 20 instead of 21!
var d = new Date("2010/03/21");
document.write(d.getDate());
What am I doing wrong? Is this a JavaScript bug?
I'm trying to create an array of the next 5 working week days (Monday - Friday, excluding today). I know the working week varies around the world but this is not important for what I am trying to do.
So, for example, if today is a Wednesday, I want the dates for Thursday and Friday of the current week and Monday, Tuesday and Wednesday of the following week.
I thought this would work:
$dates = array();
for ($i = 1; $ < 6; $i ++)
{
$dates[] = date('Y-m-d', strtotime('+ '.$i.' weekday'));
}
But for today, it is giving me:
Monday 1st
Tuesday 2nd
Wednesday 3rd
Thursday 4th
Sunday 7th!
Any advice appreciated.
Thanks
I want to be able to present "today" and "yesterday" for recent dates in my application. I've got a date formatter in use currently to show dates (retrieved from data records) and will keep using this for anything more than a couple of days old. I just really like the way the SMS app in the iPhone shows dates for recent messages and would like to emulate this.
The time-stamps that I have to work with are generated on a server that the phone downloads the data records from. All times are therefore generated at UTC (i.e. GMT) time.
I've been fiddling about with this for a while the solutions I've devised just seem horribly long-winded.
Can anyone suggest how to implement a method that could do this?
Cheers - Steve.
Does anyone have a handy powershell script that gets a set of files from TFS based on a modification date? I'd like to say "give me all the files in this folder (or subfolder) that were modified after X/Y/ZZZZ" and dump those files to a folder other than the folder they would normally go to. I know enough powershell to hack about and get this done, eventually, but I'm hoping to avoid that.
i have database table like this
+-------+--------------+----------+
| id | ip | date |
+-------+--------------+----------+
| 505 |192.168.100.1 |2010-04-03|
| 252 |192.168.100.5 |2010-03-03|
| 426 |192.168.100.6 |2010-03-03|
| 201 |192.168.100.7 |2010-04-03|
| 211 |192.168.100.10|2010-04-03|
+-------+--------------+----------+
how can i retirive data from this table where month=03 how to write sql to do that .
select * from table where month=03
something like that .
I need to get the exact start and end dates (month, day and year) of a given year.
E.g., 2008
Jan. 1, 2008
Mar, 30, 2008
Any thoughts on how to do this?
array = [2007, 2008, 2009, 2010]
array.each do |a|
#code to get array of date for a (year)
end
So using Google Apps Scripts with a Form, I'm able to get all the items and iterate through them using the following:
var form = FormApp.getActiveForm();
var items = form.getItems();
var item;
for(var i = 0; i < items.length; i++)
{
item = items[i];
if(item.getType() == FormApp.ItemType.DATE)
{
item = item.asDateItem();
item.dropdown.month; // I need a method like this
}
Logger.log("ItemTitle: %s ItemType: %s",items[i].getTitle(), items[i].getType()) ;
}
I can even get the DateItem that I want.
My issue is that I cannot get the dropdown boxes from the DateItem. Does anyone know how to get the dropdown boxes from the DateItem? (Like: item.dropdown.month or item.dropdown.day, etc).
Hello. I don't know if it has been asked before, couldn't find it either.
Is it possible to control the type of the input text that is rendered by an asp:TextBox? I would like to change it to <input type="date">
any suggestions or comments are welcome, thanks
I wish to plot a line graph where the x-axis is defined as a number of days between two dates and the y-axis is a value that varies on each of the days.
I can plot the y values as an NSNumber but I have no idea how to set the ranges and the markup on the x-axis. I have looked at the date example in the "examples" directory of the core-plot distribution but have found it a little confusing.
Does anyone know of a tutorial, or code sample, which might asist me in this regard?
Thank you in advance.
Hey.
I'm trying to format a date from a string into another format.
For example: 2012-05-29 23:55:52 into 29/05 *newline* 2010.
I just don't get the logics behind NSDate and NSDateFormatter, I think..
Any help will be appreciated. Thanks :)
I have DateFirstStarted and DateEnded fields in the database.
Date values are recorded as
DateFirstStarted
04/13/2010 07:00:00.000 PM
DateEnded
04/13/2010 09:00:00.000 PM
How do I print minute difference between two dates. I tried the following code but it returned something like 999343
Clock = DateDiff("m", objLiveCommentary("DateFirstStarted"), objLiveCommentary("DateEnded"))
I need to port this following from Oracle syntax to Postgresql. Both FLO_END_DT and FLO_START_DATE are of type DATE in Oracle, and TIMESTAMP WITHOUT TIME ZONE in Postgresql:
SELECT
TRUNC( TO_CHAR(ROUND(( FL.FLO_END_DT- FL.FLO_START_DT)* 24), '9999D99'),2)
FROM
FLOWS FL
I am not familiar enough with Oracle to know what it is trying to accomplish.
Any ideas?
A client of mine needs the ability to expire pages on specific dates. When that date arrives, the page should be inaccessible (possibly switch to a non-published state) and should not appear in all menus.
Any idea how to go about this?
table1
- date1 datetime not null
- date2 nvarchar null
I want to get the latest date of this two.
select date1, date2,
(CASE WHEN date1 > CAST(date2 as DateTime) THEN date1 ELSE date2 END) as DateTime) as LatestDate
from table1
please note that date2 can be null. in this case, date1 win.
I have C# web application that I want it to send out an email on a certain date, such as if equipment isn't returned on the day it was due. Data is in MS SQL database.
I've got all the email code already done, and I'm just curious how do I trigger this email, say after the COB on that particular day?
Thanks,
Eric