fubark / cyber

Fast and concurrent scripting.

Home Page:https://cyberscript.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

date functions

GabCores opened this issue · comments

Hi ! for working on some testings I have choose a project that need date functions

and then get values for hours , minutes and seconds
May be, it is not implemented yet ?
regards

commented

I haven't looked into this but it's probably not that simple to do. I think for now this should be an external library that you import that binds to an existing C/C++ date library.

ok, no problem , to call an endpoint will be my workaround.
By the way , how to convert a json string into a json object , for using CYON ?

commented

There's no JSON library atm. @matu3ba was thinking of making one. You can use parseCyon to get back an object from a cyon string.

using parseCyon would be an option ,
Trying to test it , i wrote

strJson = "{ name: 'John Doe'}"
objJson = parseCyon(strJson)
print objJson.name

but i got an error
ParseError: Expected right brace.
pp = "{ name: 'John Doe'}"
..........................^

What am I doing wrong ?

commented

I'm already seeing problems with {} for string interpolation 😅. For now you can do this:

strJson = "\{ name: 'John Doe'\}"
objJson = parseCyon(strJson)
print objJson.name