How to fix date format?

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Apr 25 20:46:39 PDT 2017


On Tuesday, 25 April 2017 at 20:10:02 UTC, Jonathan M Davis wrote:
> On Tuesday, April 25, 2017 17:41:25 Suliman via 
> Digitalmars-d-learn wrote:
>> I am using mysql native. Date in DB have next format: 
>> 2016-11-01 06:19:37
>>
>> But every tile when I am trying to get it I am getting such
>> format:
>> 2016-Oct-31 15:37:24
>>
>> I use next code:
>> writeln(point[1].coerce!string);
>>
>> Why coerce is forcing format changing? How I can extract 
>> result as without month name between digits or easily convert 
>> it in proper data format?
>
> What types are dealing with here? What is point[1]?
>
> - Jonathan M Davis

writeln(point[1].coerce!string);
writeln(point[1].type);

>std.datetime.DateTime
>std.variant.VariantN!20LU.VariantN


More information about the Digitalmars-d-learn mailing list