# Conversion variable heure "hh:mm" en 2 variables numériques heure et minutes, et vice-versa

**URL:** <https://community.homey.app/t/conversion-variable-heure-hh-mm-en-2-variables-numeriques-heure-et-minutes-et-vice-versa/76756>\
**Category:** Questions & Aide\
**Created:** [February 22, 2023, 5:23pm UTC](https://community.homey.app/t/conversion-variable-heure-hh-mm-en-2-variables-numeriques-heure-et-minutes-et-vice-versa/76756 "2023-02-22T17:23:30Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [February 23, 2023, 10:05pm UTC](https://community.homey.app/t/conversion-variable-heure-hh-mm-en-2-variables-numeriques-heure-et-minutes-et-vice-versa/76756/6 "2023-02-23T22:05:12Z")

</div>

I am sorry, i do not speak or write French, so i’ll do this in English.

If i understand you correct, i think you might like the format card in the [Better Logic Library App](https://homey.app/nl-nl/app/net.i-dev.betterlogic/).

[[APP][Pro] Better Logic Library - For Users - Apps - Homey Community Forum](https://community.homey.app/t/app-pro-better-logic-library-for-users/71876/2)

it has a Format card which gives parts of the date exactly how you want it, based on your locale settings and timezone (configurable through the settings):

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/2/e/2e85472773bf65613e69e150567c1c4e29b2ce06.png)  
(You can type anything you like it in and select the top one, which is what you typed).  
Now, this can be placed into variables directly:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/d/4d1be5a9b8b42c0102dfe390096f2033e3844748.png)

\*Set [variable] to BLL Expression cards  
Press execute to create the variables and tokens.

Now, to get this back to a HH:mm value, u can use this one: Execute Expression as Tag:  
 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/6/f6c585022a18391587f09cfa20cbbed823bb00d2.png)

```auto
"[Hour]".padStart(2,'0') + ':' + "[Minutes]".padStart(2,0)

```

\*Watch the double-quotes 😉

This will result in the time as usual:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/a/da5f6776beefa4023019d8e15b507328cdd49770.png)

N.b.  
Update to version 2.3.11 of BLL (in test now) to be able to create new variables through the expressionflowcard and resolve a bug where tags are not filled with a value at the first creation.

---

_[View the full topic](https://community.homey.app/t/conversion-variable-heure-hh-mm-en-2-variables-numeriques-heure-et-minutes-et-vice-versa/76756)._
