5,606,347 Members 33,305 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Adding a value to the current hour

Tip us?
 
dgrasley
Old
#1  
Junior Member - OP
Thanks Meter 2
Posts: 3
Join Date: Jan 2014
Default [Q] Adding a value to the current hour

Is there ANY way to add a number (1) to the current hour? I've been trying to figure it out for hours but I'm not getting anywhere.

I've tried variations of this:
$#Dmm#>50&&#Dmm#<60?hour plus one is (#Dh#+1)$

Anyone?
 
HyperAbarth
Old
#2  
Member
Thanks Meter 30
Posts: 96
Join Date: May 2012
Quote:
Originally Posted by dgrasley View Post
Is there ANY way to add a number (1) to the current hour? I've been trying to figure it out for hours but I'm not getting anywhere.

I've tried variations of this:
$#Dmm#>50&&#Dmm#<60?hour plus one is (#Dh#+1)$

Anyone?
Hi;
Here I've insert a code to add Day to Date:
http://forum.xda-developers.com/show....php?t=2607763
Probably same syntax could work also for time ... but there is a BIG problem:
Zooper consider Date as a number then if I add 10 to 25th January I obtain 35th January!!! Then I can't use this for my purpose
I don't know if you will have the same problem also with Time.
 
kwerdenker
Old
#3  
kwerdenker's Avatar
Recognized Themer
Thanks Meter 1568
Posts: 1,238
Join Date: Apr 2010
Location: Probably the Zooper Forums
Quote:
Originally Posted by dgrasley View Post
Is there ANY way to add a number (1) to the current hour? I've been trying to figure it out for hours but I'm not getting anywhere.

I've tried variations of this:
$#Dmm#>50&&#Dmm#<60?hour plus one is (#Dh#+1)$

Anyone?
Try it like this
Code:
$#Dmm#>50&&#Dmm#<60?(#Dh#+1)$
and it should work. Zooper seems to have a problem if you try to mix characters/text and math. If you want to have text AND math in one text module, split them up so you have something like this
Code:
hour plus one is $#Dmm#>50&&#Dmm#<60?(#Dh#+1)$
If you need the text also to be dependent on the conditional, you'll have to use it twice:
Code:
$#Dmm#>50&&#Dmm#<60?hour plus one is $$#Dmm#>50&&#Dmm#<60?(#Dh#+1)$
Mobile: LG Nexus 4 | ROM: Paranoid Android 4.0 + Xposed | Kernel: faux Kernel
Tablet: Asus Nexus 7 (2013) | ROM: Paranoid Android 3+ | Kernel: faux Kernel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes