question

Jarek O avatar image
1 Like"
Jarek O asked Steven Hamoen commented

_mkgmtime64 failure in convert()

Hi everyone,

When I try this:

return convert("di 17 nov 1964",DATE_STR,XL_DATETIME);

in the scripter I get the error:

exception: Invalid convert command: _mkgmtime64 failure

the image is broken, but where exactly does it go wrong?

I get the same error when trying similar examples..

flexscript
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Steven Hamoen avatar image
2 Likes"
Steven Hamoen answered Steven Hamoen commented

@Jarek O I think there are a few issues. First if you are using the weekday abbreviations there have to be 3 characters and I think they have to be the English version (so in this case "Tue" from Tuesday and not "Din" from Dinsdag). Also the weekday name and the month name have to start with capitals (so "Nov" and not "nov") and finally apparently the function only works with times after 1-1-1970 which is the Unix base time. Although Excel can deal with dates starting from 1-1-1900 a lot of other functions are based on the Unix base time so I guess that is a limitation.

So

return convert("Tue 17 Nov 1970", DATE_STR, XL_DATETIME);

works fine and gives 25889

· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jarek O avatar image Jarek O commented ·

Thank you, I have another question on this.

Unix base time gives the time format as "11:45:32" for example.

If I want to convert this to XL_DATETIME it throws not valid time string.

string b = "10:48:00";
return convert(b, TIME_STR, XL_DATETIME);

What did I do wrong?

0 Likes 0 ·
Steven Hamoen avatar image Steven Hamoen Jarek O commented ·

@Jarek O I forgot to mention but the strings have to match the time and date format settings that can be found under Edit->Model Settings. And there you can see that the time needs either and AM or PM after the h:mm:ss. So you can either add those to your string or change the format to match your string.

1 Like 1 ·