Solved

Date problem. Flash not accepting date string

Posted on 2007-03-30
2
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 37

Accepted Solution

by:
CyanBlue earned 500 total points
ID: 18823222
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
ID: 18828177
Thats strange.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
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.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

730 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