Solved

Date problem. Flash not accepting date string

Posted on 2007-03-30
2
166 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

Independent Software Vendors: 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

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
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.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

691 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