SPOD and SQLite (target PHP): sporadic bug with Date

59 views
Skip to first unread message

shal

unread,
Feb 9, 2016, 3:41:37 AM2/9/16
to Haxe
Sometimes instead of writing an actual date, it just writes a string "Date" there. The code is simple:

...
if (entry.firstEntered==null) {
   
var now = Date.now();
   trace
('I am first time here, the date is '+now);
   entry
.firstEntered = now;
   entry
.update();
}
...

Then I look at the field "firstEntered" instead of smth like
2016-02-09 09:31:44
I see
Date
just a word "Date" and that's all! 
Another interesting thing is that trace always shows the date string representation.
Target is PHP.

But it happens sporadically.

François Barbut

unread,
Feb 12, 2016, 3:22:28 AM2/12/16
to Haxe
I use haxe/PHP quite often and I never had this problem.

Anyway, most of the basic objects in haxe have a toString() method which is called automatically when you print or trace them.

For an unknown reason this method may not be called in your case , could you try this :   trace('I am first time here, the date is '+now.toString());

Cauê Waneck

unread,
Feb 12, 2016, 8:20:59 AM2/12/16
to Haxe

This sounds like a problem with dce


--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages