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

data and time #22

Open
gedw99 opened this issue Nov 9, 2023 · 4 comments
Open

data and time #22

gedw99 opened this issue Nov 9, 2023 · 4 comments

Comments

@gedw99
Copy link

gedw99 commented Nov 9, 2023

Describe the solution you'd like

https://github.com/golang-module/carbon could be used to give all aspects the ability to convert datas and times.

SO then we can incorporate this. It's needed in GUI and when you translate time between a DB and a GUI and back again. DB always should store dates as UTC, but GUI should show in dates adjusted to their own time zone.

@vorlif
Copy link
Owner

vorlif commented Dec 4, 2023

Hi @gedw99

There is no plan to add carbon or something like this. I want to keep the dependencies as small as possible. Also, since Django translations are currently used, more languages are supported.

You should keep a machine-readable format in the database, yes. But I don't understand the association with the libraries?
If you prefer to use carbon, that shouldn't be a problem.

@gedw99
Copy link
Author

gedw99 commented Dec 5, 2023

I agree that fat dependencies are a bad idea.

I think we can write our own pretty easily if your up for it.

You said you did not understand the need ? Well say you have a sentence that has numbers or date time in it. You want to show it in the Users own locale of how they represent date time.

But you also need to convert that date time to their dat time zone too. Typically date time is always stored as UTC time in any medium ( db, etc ) and converted on the fly to the users own data time zone.

so thats just 2 primary examples that combine into 1.

@vorlif
Copy link
Owner

vorlif commented Dec 6, 2023

I understand that time must be kept in a machine-readable format during machine processing. (e.g. databases). However, I don't quite understand what role spreak or carbon play here. Spreak can convert a time into a human-readable format in different languages. Carbon does the same, in addition, it offers a lot of functions for editing time and timezones. There is no necessary connection between time zone and language.

Can you perhaps give a brief example of what should or should not work?

@gedw99
Copy link
Author

gedw99 commented Dec 7, 2023

yeah I think your right about not needing carbon.

The use case is that you have a string that has date time in it and we need to convert that date time into the the users locale. So for German versus English the structure of how Date time is presented as a string is very different. Hope fully that is a concise enough example use case ?

I think I need to play with the code and see what it can handle with data time aspects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants