Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time.TimeParseError: Invalid time format code: 0, error: invalid month three letters #20073

Closed
AritraBanik08 opened this issue Dec 2, 2023 · 5 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@AritraBanik08
Copy link

AritraBanik08 commented Dec 2, 2023

Describe the bug

Code: https://vosca.dev/p/742e925f3f

import time

fn main() {
	c := 'Dec 04 2023'
	s := time.parse_format(c, 'MMM DD YYYY') or { panic(err) }
	a := s.str()
	t := time.parse(a) or { panic('failing format: ${a} | err: ${err}') }
	println(t)
}

Reproduction Steps

Run the above code please. Thank you.

Expected Behavior

2023-12-04 00:00:00

Current Behavior

Output:

V panic: time.TimeParseError: Invalid time format code: 0, error: invalid month three letters
v hash: cd337e2
/tmp/v_60000/../../../../../../home/admin/v/vlib/builtin/builtin.c.v:119: at _v_panic: Backtrace
/tmp/v_60000/../../../../../../box/code.v:5: by main__main
/tmp/v_60000/../../../../../../tmp/v_60000/code.14312254348786731813.tmp.c:17024: by main
Exited with error status 1

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.3 cd337e2

Environment details (OS name and version, etc.)

V full version: V 0.4.3 cd337e2
OS: linux, Debian GNU/Linux 11 (bullseye) (VM)
Processor: 1 cpus, 64bit, little endian, Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz

getwd: /home/admin/playground
vexe: /home/admin/v/v
vexe mtime: 2023-11-11 13:42:45

vroot: OK, value: /home/admin/v
VMODULES: OK, value: /.vmodules
VTMP: OK, value: /tmp/v_0

Git version: git version 2.30.2
Git vroot status: Error: fatal: not a git repository (or any of the parent directories): .git
.git/config present: false

CC version: cc (Debian 10.2.1-6) 10.2.1 20210110
thirdparty/tcc: N/A

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@AritraBanik08 AritraBanik08 added the Bug This tag is applied to issues which reports bugs. label Dec 2, 2023
@Delta456
Copy link
Member

Delta456 commented Dec 5, 2023

The snippet given by you is working. Please try the latest version of V, the playground seems very outdated.

2023-12-04 00:00:00

@Delta456 Delta456 closed this as completed Dec 5, 2023
@AritraBanik08
Copy link
Author

I am already using the latest version of Vlang. Please test by running the code on https://play.vlang.io/. Thank you.

@shove70
Copy link
Contributor

shove70 commented Dec 5, 2023

The version at https://play.vlang.io/ is not the latest

The version at https://play.vosca.dev/ will be updated, so test it out here:

image

@AritraBanik08
Copy link
Author

The V version 0.4.3 4b31092 is not available on github, where can I get it?

@shove70
Copy link
Contributor

shove70 commented Dec 6, 2023

Can you provide information that is not available?

Please refer to:
https://github.com/vlang/v/blob/master/README.md#installing-v-from-source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

3 participants