Loading
  Password:
  Lost password?  
LogoutLOGOUT
Join as a MemberJoin as a Member
 
FlashMove Live Support



Go Back   FlashMove Forums > Development > Archives > Flash MX

ReplyREPLY THREAD
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-29-2004, 06:40 PM
sanj sanj is offline
Registered User
 
Join Date: Apr 2002
Posts: 46
sanj is on a distinguished road
Compare dates

Hi,

IS it possible to compare 2 dates:

PHP Code:

var date1 29/06/2004 12:53;

var 
date2 2/5/29 10:33;
timediff date1 date1;
trace(timediff); 


Any help is appreciated!

Thanks,

Sanj
  #2  
Old 06-29-2004, 07:56 PM
FrozenMedia's Avatar
FrozenMedia FrozenMedia is offline

Frozen Moderator
 
Join Date: Apr 2003
Location: United Kingdom
Posts: 2,701
FrozenMedia is on a distinguished road
Not that easily:

I haven't needed to come up with a method myself but over at proto there's a list of helpful things to at least get you started:

http://proto.layer51.com/l.aspx?p=9

...and remember, always useful:

86400000 milliseconds in a DAY (useful for stuff like this:

Actionscript:
/*****************************************************************************
** This is a very simple function that will give you a date object for ANY 
** day offset from current date (or from any other date object). 
** e.g. newDateObject = oldDateObject.getDateOffset(-5);
** 		offset is in Days (1 = Tomrw, -1 = Yesterday)
********************************************************************************/

Date.prototype.getDateOffset = function(offset)
{
	var retDate = new Date(this);
	retDate.setTime(retDate.getTime()+offset*86400000); // 86400000 represents a number of milliseconds each day haves
	return retDate;
}

Rich

)
__________________
Blog: http://www.richardleggett.co.uk | If your happy with the help, let us know about it
  #3  
Old 06-30-2004, 07:06 AM
sanj sanj is offline
Registered User
 
Join Date: Apr 2002
Posts: 46
sanj is on a distinguished road
Thanks Frozenmedia,

I found something I can use from your link!

Thanks again.

Sanjay


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting dates for use with new Date Object PUP100 Flash MX ActionScript 5 07-30-2003 11:21 AM
How do I get Flash to compare to Varibles that are strings flashgirl Flash 5 Actionscript 5 10-15-2001 03:26 PM
Urgent: How to compare strings Cecil General Flash 4 11-30-2000 07:36 AM



All times are GMT. The time now is 10:06 PM.




Powered by vBulletin version 3.5