Format Date Time block does not work with an saved instant

I checked out Bugs in Kodular Eagle before creating a new topic

Describe your issue

When I try to use format date time with an instant saved in a tinydb it fails

Steps to reproduce the issue

Trying to use the Format Date Time block with an instant saved in a TinyDB

Expected Behaviour

Format the date and time correctly

Actual Behaviour

It gives an error and says “The operation FormatDateTime cannot accept the arguments”

Show your Blocks


A simple project that I did to demonstrate the problem
Clock_Bug.aia (2.4 KB)

Android version

10
Motorola One Fusion

Sorry if something is not understood but I do not speak English and I am using a translator
The problem occurs in companion and in exported apk

Currently, you cannot save a “raw” instant to the tinydb. Save the formatted value (text) instead.

1 Like

Use this one to save to DB

1 Like

hi @Eddie_Gerardo welcome to community

i think its not a bug.

this is because instant cannot run from text or strings, see this explanation.
format date time

This block describes strings and not strings

for the solution you have to put get time now into a variable. to get time and store value to tinydb,
and you will see the result of pressing button1, button 2 and button 3 on the label formated and unformated.
(see my block)

note:
(on your block)
when you press button 1, you get time now for formated and unformated labels.

then you press button 2 and you get time now to store value to tinydb, but there is a time difference between pressing button 1 and button 2, so you get time now on button 2 which is different from button 1.
you have to input get time now into the variable, as I explained.

hope this clears up your problem.

1 Like

Hello everyone!
Thanks for the solutions. Sorry for the delay in answering, I’ve been busy these days.
The problem was solved.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.