?
Solved

Date problem. Flash not accepting date string

Posted on 2007-03-30
2
Medium Priority
?
168 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

777 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