This has probably been answered dozens of times, couldn't find the answer though...
Anyway, working in a Smalltalk environment I have a string composed of three parts like this: "ttm 4/6/97 00:08". The string is very variable, meaning some part may be missing (so it would be a string composed of less then three parts like "ttm 4/6/97") ...
I'm really drawing a blank on this one. I've been working on globalization but the DateTime seems to always revert back to the CurrentThread's culture. I broke this down into smaller steps hoping to find my issue, but it's starting to drive me crazy.
I've got a textbox with the date expressed as a string:
// the CurrentThre...
I want to get the UTC time for 01/01/2100 in Java to '2100-01-01 00:00:00'. I am getting "2100-01-01 00:08:00". Any idea, how to correct this.
public Date getFinalTime() {
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
Date finalTime = null;
tr...
How can I write a script to detect when a user changes their system time in JS?
...
Hi all...
I want only Hr and Min in time format so i did
select convert(varchar(20),GETDATE(),108) ===>> output is "12:57:54"
but i want only "12:57" this much so how i will do that in sql server
...
I wanted to assign null value to DateTime type in c#, so I used:
public DateTime? LockTime;
When LockTime is not assigned LockTime.Value contains null by default.
I want to be able to change LockTime.Value to null after it has been assigned other value.
...
Consider this simple user defined function:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER FUNCTION [dbo].[ufn_GetFirstDayOfMonth] ( @pInputDate DATETIME )
RETURNS DATETIME
BEGIN
RETURN CAST(CAST(YEAR(@pInputDate) AS VARCHAR(4)) + '/' +
CAST(MONTH(@pInputDate) AS VARCHAR(2)) + '/01' AS DATETIME)
END
whi...
i have to sent an email when a user register email contain a link that is become invalid after six hours
what i m doing when email is sent i update the db with field emailSentDate of type "datetime"
now i got the curent date and time and has made to the same formate as it is in db now i want to find that both these dates and time have di...
I have a table (called 'entry') which has a datetime column (called 'access_date'), and I want to do an SQLAlchemy query that only produces results where entry.access_date is a Monday (or any other day of the week specified by a number [0..6]).
Is this possible? I am using sqlite & SQLalchemy 0.5.8 if that makes any difference.
...
My background is C, Java, C#, and VB.NET, but I have to work on some basic PHP stuff. I've gotten to this line of code:
if($flag) $event_end--;
What exactly is being decremented? The raw ticks? $flag (I think) represents if the event is an all-day event, where the start would be 7/1/2010 and end would be 7/2/2010. Does the -- esse...
I'm using oracle 11g.
I'm inserting date and time using function SYSDATE into column with type TIMESTAMP. But fractional seconds always are 0.
How can I insert date and time of database server with fractional seconds? Is there any functions?
...
I have a large set (100+ million) of observations with the date represented as a custom string format. We did not generate the date strings, I just need to convert the date string to a datetime type.
How do I convert a string date (eg, 12 JUN 2010) to a datetime? My thoughts are to parse the string into components, assemble them in the...
Is there a way to run a custum SQL statement in Django? I have some timestamp fields in my database that have timezone information. Normally you could just enter the time in a format like: 2010-7-30 15:11:22 EDT and in my case postgresql will figure it out. But in Django it treats timestamps as Datetimes which don't store timezone inform...
I have a string I need to convert back to a date. I can call .ToString("yyyyMMdd") and get the string i want. My question is how can I convert that back into a date? I'm trying something like the following with no luck.
DateTime d;
var formatInfo = new DateTimeFormatInfo {ShortDatePattern = "yyyyMMdd"};
if (DateTime.TryParse(details.Det...
heres a table, the time when the query runs i.e now is 2010-07-30 22:41:14
number | person | timestamp
45 mike 2008-02-15 15:31:14
56 mike 2008-02-15 15:30:56
67 mike 2008-02-17 13:31:14
34 mike 2010-07-30 22:31:14
56 bob 2009-07-30 22:37:14
67 bob 2009-07-30 22:37:14
22 ...
Here's the code:
$ical = Date::ICal->new( year => 1964, month => 10, day => 16,
hour => 20, min => 12, sec => 47,
#tz => '0530'
);
ok( defined $ical, 'new() returned something' );
ok( $ical->isa('Date::ICal'), " and it's the right class" );...
I just finished writing a date parser for my ECMAScript implementation. Previously I had written a regular expressions compiler and I was really impressed with the way the spec described the process. Essentially the input is passed through a series of continuations that test each portion of the string. My date parser is loosely based aro...
I want to format Date of the GridView Cell text like
ddMMMYYYY
(i.e)
07MAY2010
how to achieve this?
RowDataBound()
{
....
e.Row.Cells[10].Text = ......?
}
...
I'm trying to change this timestamp
2010-08-02 00:28:20
to month/day/year -
08/02/10
..in the query (I know that doing it in the query is faster).
$sql = "SELECT * FROM posts ORDER BY post_date DESC";
I tried using the DATE_FORMAT() in the query many ways but I can't seem to get it right.. Can someone please share how to ...
distance_of_time_in_words(strtotime(2010-08-07), strtotime(2010-08-01))
returns '6 minutes'
$a = '2010-08-02 00:39:29'
$b = '2010-08-01'
distance_of_time_in_words($a, $b)
returns 'less than a minute'
$a = '2010-08-02 00:39:29'
$b = '2010-08-01 20:08:00'
distance_of_time_in_words($a, $b)
returns 'less than a minute'
I wonder if I...