Solved

Date problem. Flash not accepting date string

Posted on 2007-03-30
2
156 Views
Last Modified: 2010-04-03
Hi
I cant get Flash to regonize this string "2007-01-16 19:45:00.0 GMT" as a date.

1. Tried this and got in the trace "Invalid time"
datestring = "2007-01-16 19:45:00.0 GMT";
var newdate:Date = new Date();
newdate.setTime(datestring );
trace(newdate);

2. Then I tried this and got again "Invalid time"
datestring = "2007-01-16 19:45:00.0 GMT";
var newdate:Date = new Date(datestring);
trace(newdate);
0
Comment
Question by:Fern2
2 Comments
 
LVL 37

Accepted Solution

by:
CyanBlue earned 500 total points
Comment Utility
That's not a valid format that Flash can understand...  
You basically have to split that string and create something like this...

var newdate:Date = new Date(2007, 0, 16, 19, 45, 0, 0);
trace(newdate);

CyanBlue
0
 
LVL 1

Author Comment

by:Fern2
Comment Utility
Thats strange.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now