Hours and Minutes addition in Solaris

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












My same question here maybe closed (I already received two close votes). I hope one of you can help here. Here's my question:



I work in a solaris server and the date -d option is not there. No gdate as well. I know fair amount of questions have been asked related to this, I have gone through almost all of them. But I don't know perl so I don't know how to modify those answers w.r.t my requirement.



Here's what I have which works in Linux:



date -d "$hr:$mi $duration minutes" +'%H%M'


where $hr and $mi are hours and mins, $duration is in minutes.



When I run like this in Linux, I get this:



date -d "23:28 60 minutes" +'%H%M'
0028


When I run this in solaris, I get:



date: illegal option -- d Usage: date [-u] ...


Is there an awk solution here since my perl is ancient?



Requote, I'm having the same problem as here, only I don't have the luxury of using date -d. I'm open to any solution in python or perl, need not be an one liner.







share|improve this question




















  • Do you have ksh93 shell available to you?
    – fpmurphy1
    Nov 11 '17 at 8:42










  • @fpmurphy1 no, I don't have ksh93. Only ksh or bash.
    – mathB
    Nov 11 '17 at 8:51














up vote
0
down vote

favorite












My same question here maybe closed (I already received two close votes). I hope one of you can help here. Here's my question:



I work in a solaris server and the date -d option is not there. No gdate as well. I know fair amount of questions have been asked related to this, I have gone through almost all of them. But I don't know perl so I don't know how to modify those answers w.r.t my requirement.



Here's what I have which works in Linux:



date -d "$hr:$mi $duration minutes" +'%H%M'


where $hr and $mi are hours and mins, $duration is in minutes.



When I run like this in Linux, I get this:



date -d "23:28 60 minutes" +'%H%M'
0028


When I run this in solaris, I get:



date: illegal option -- d Usage: date [-u] ...


Is there an awk solution here since my perl is ancient?



Requote, I'm having the same problem as here, only I don't have the luxury of using date -d. I'm open to any solution in python or perl, need not be an one liner.







share|improve this question




















  • Do you have ksh93 shell available to you?
    – fpmurphy1
    Nov 11 '17 at 8:42










  • @fpmurphy1 no, I don't have ksh93. Only ksh or bash.
    – mathB
    Nov 11 '17 at 8:51












up vote
0
down vote

favorite









up vote
0
down vote

favorite











My same question here maybe closed (I already received two close votes). I hope one of you can help here. Here's my question:



I work in a solaris server and the date -d option is not there. No gdate as well. I know fair amount of questions have been asked related to this, I have gone through almost all of them. But I don't know perl so I don't know how to modify those answers w.r.t my requirement.



Here's what I have which works in Linux:



date -d "$hr:$mi $duration minutes" +'%H%M'


where $hr and $mi are hours and mins, $duration is in minutes.



When I run like this in Linux, I get this:



date -d "23:28 60 minutes" +'%H%M'
0028


When I run this in solaris, I get:



date: illegal option -- d Usage: date [-u] ...


Is there an awk solution here since my perl is ancient?



Requote, I'm having the same problem as here, only I don't have the luxury of using date -d. I'm open to any solution in python or perl, need not be an one liner.







share|improve this question












My same question here maybe closed (I already received two close votes). I hope one of you can help here. Here's my question:



I work in a solaris server and the date -d option is not there. No gdate as well. I know fair amount of questions have been asked related to this, I have gone through almost all of them. But I don't know perl so I don't know how to modify those answers w.r.t my requirement.



Here's what I have which works in Linux:



date -d "$hr:$mi $duration minutes" +'%H%M'


where $hr and $mi are hours and mins, $duration is in minutes.



When I run like this in Linux, I get this:



date -d "23:28 60 minutes" +'%H%M'
0028


When I run this in solaris, I get:



date: illegal option -- d Usage: date [-u] ...


Is there an awk solution here since my perl is ancient?



Requote, I'm having the same problem as here, only I don't have the luxury of using date -d. I'm open to any solution in python or perl, need not be an one liner.









share|improve this question











share|improve this question




share|improve this question










asked Nov 10 '17 at 14:11









mathB

1478




1478











  • Do you have ksh93 shell available to you?
    – fpmurphy1
    Nov 11 '17 at 8:42










  • @fpmurphy1 no, I don't have ksh93. Only ksh or bash.
    – mathB
    Nov 11 '17 at 8:51
















  • Do you have ksh93 shell available to you?
    – fpmurphy1
    Nov 11 '17 at 8:42










  • @fpmurphy1 no, I don't have ksh93. Only ksh or bash.
    – mathB
    Nov 11 '17 at 8:51















Do you have ksh93 shell available to you?
– fpmurphy1
Nov 11 '17 at 8:42




Do you have ksh93 shell available to you?
– fpmurphy1
Nov 11 '17 at 8:42












@fpmurphy1 no, I don't have ksh93. Only ksh or bash.
– mathB
Nov 11 '17 at 8:51




@fpmurphy1 no, I don't have ksh93. Only ksh or bash.
– mathB
Nov 11 '17 at 8:51










3 Answers
3






active

oldest

votes

















up vote
2
down vote



accepted










there is a single little difficulty : splitting arround ":", there is an awk function : split(what,where,sep).



I tried in a solaris (it is a one line command)



echo 23:28 60 |
awk 'split($1,H,":") ; printf "%2d:%02dn",H[1]+(H[2]+$2)/60, (H[2]+$2)%60 '


where



  • split($1,H,":") will put 23 in H[1] and 28 in H[2]

use



echo 23:28 60 |
awk 'split($1,H,":") ; printf "%2d:%02dn",(H[1]+(H[2]+$2)/60)%24, (H[2]+$2)%60 '


to stay in 0-23 range for hour. change format string in printf to "%02d:%02dn" to have a leading 0






share|improve this answer






















  • Interesting. I'll check this out when I reach home. I've decided to install Solaris on a VM and try anyway as this was nagging me for a long time today. Thanks!
    – mathB
    Nov 10 '17 at 15:36










  • This gives me 24:28. I need it to be 00:28. The 60 in the question is not constant, it varies - sometimes it'd be 120 or even 600. In that case, I don't want the result to show over 24 hours.
    – mathB
    Nov 10 '17 at 17:36










  • That just about does it! Thank you! echo 23:28 60 | awk 'split($1,H,":") ; printf "%2d:%02dn",(H[1]+(H[2]+$2)/60)%24, (H[2]+$2)%60 '
    – mathB
    Nov 11 '17 at 2:12

















up vote
0
down vote













With awk, you could do the following:



awk -v dayt="2017 11 10 23 28 23" 'tmstmp=mktime(dayt)+60;print strftime("%M:%S",tmstmp)' <<< ""


Pass the FULL date and time to awk with the -v flag and then use the awk mktime to get a number representation of the date/time, adding 60 and then strftime to convert the representation to the required format.






share|improve this answer




















  • I'll check this on Monday as I've lost access to my system. Thanks for the answer and have a good weekend!
    – mathB
    Nov 10 '17 at 15:23










  • I guess I need %H%M in the answer, and this works in Linux, but not in Solaris. I get syntax error: < unexpected
    – mathB
    Nov 11 '17 at 2:13






  • 1




    1) I am not sure solaris's awk will accept mktime/strftime function, maybe gawk will. 2) you can use a second variable instead fo 60. 3) you can also use echo | ...
    – Archemar
    Nov 11 '17 at 13:29

















up vote
0
down vote













This is a bit of a experimental hack but works with modern versions of bash. I tested it on CentOS 7 and Fedora 26



#!/bin/bash

hr="23"
mi="28"
duration="60"

printf '%(%H%M)Tn' "$((-(19 * 60 * 60) + (hr * 60 * 60) + (mi * 60) + (duration * 60) ))"


Result is 0028.






share|improve this answer




















  • Hmmm. This works on a Ubuntu bash (I get 1058 instead of 0028 but I guess that's timezone thing?), but not on Solaris bash :D No idea why, but I'm getting this error - bash: printf: '(': invalid format character. I've double checked, did not mess up the braces.
    – mathB
    Nov 11 '17 at 13:37










  • What version of bash on Solaris? Looks like an old version where %T not supported. What version of Solaris?
    – fpmurphy1
    Nov 11 '17 at 15:54











  • Version 10 of Solaris and version 3.2.51(1) of bash
    – mathB
    Nov 11 '17 at 15:59










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403760%2fhours-and-minutes-addition-in-solaris%23new-answer', 'question_page');

);

Post as a guest






























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote



accepted










there is a single little difficulty : splitting arround ":", there is an awk function : split(what,where,sep).



I tried in a solaris (it is a one line command)



echo 23:28 60 |
awk 'split($1,H,":") ; printf "%2d:%02dn",H[1]+(H[2]+$2)/60, (H[2]+$2)%60 '


where



  • split($1,H,":") will put 23 in H[1] and 28 in H[2]

use



echo 23:28 60 |
awk 'split($1,H,":") ; printf "%2d:%02dn",(H[1]+(H[2]+$2)/60)%24, (H[2]+$2)%60 '


to stay in 0-23 range for hour. change format string in printf to "%02d:%02dn" to have a leading 0






share|improve this answer






















  • Interesting. I'll check this out when I reach home. I've decided to install Solaris on a VM and try anyway as this was nagging me for a long time today. Thanks!
    – mathB
    Nov 10 '17 at 15:36










  • This gives me 24:28. I need it to be 00:28. The 60 in the question is not constant, it varies - sometimes it'd be 120 or even 600. In that case, I don't want the result to show over 24 hours.
    – mathB
    Nov 10 '17 at 17:36










  • That just about does it! Thank you! echo 23:28 60 | awk 'split($1,H,":") ; printf "%2d:%02dn",(H[1]+(H[2]+$2)/60)%24, (H[2]+$2)%60 '
    – mathB
    Nov 11 '17 at 2:12














up vote
2
down vote



accepted










there is a single little difficulty : splitting arround ":", there is an awk function : split(what,where,sep).



I tried in a solaris (it is a one line command)



echo 23:28 60 |
awk 'split($1,H,":") ; printf "%2d:%02dn",H[1]+(H[2]+$2)/60, (H[2]+$2)%60 '


where



  • split($1,H,":") will put 23 in H[1] and 28 in H[2]

use



echo 23:28 60 |
awk 'split($1,H,":") ; printf "%2d:%02dn",(H[1]+(H[2]+$2)/60)%24, (H[2]+$2)%60 '


to stay in 0-23 range for hour. change format string in printf to "%02d:%02dn" to have a leading 0






share|improve this answer






















  • Interesting. I'll check this out when I reach home. I've decided to install Solaris on a VM and try anyway as this was nagging me for a long time today. Thanks!
    – mathB
    Nov 10 '17 at 15:36










  • This gives me 24:28. I need it to be 00:28. The 60 in the question is not constant, it varies - sometimes it'd be 120 or even 600. In that case, I don't want the result to show over 24 hours.
    – mathB
    Nov 10 '17 at 17:36










  • That just about does it! Thank you! echo 23:28 60 | awk 'split($1,H,":") ; printf "%2d:%02dn",(H[1]+(H[2]+$2)/60)%24, (H[2]+$2)%60 '
    – mathB
    Nov 11 '17 at 2:12












up vote
2
down vote



accepted







up vote
2
down vote



accepted






there is a single little difficulty : splitting arround ":", there is an awk function : split(what,where,sep).



I tried in a solaris (it is a one line command)



echo 23:28 60 |
awk 'split($1,H,":") ; printf "%2d:%02dn",H[1]+(H[2]+$2)/60, (H[2]+$2)%60 '


where



  • split($1,H,":") will put 23 in H[1] and 28 in H[2]

use



echo 23:28 60 |
awk 'split($1,H,":") ; printf "%2d:%02dn",(H[1]+(H[2]+$2)/60)%24, (H[2]+$2)%60 '


to stay in 0-23 range for hour. change format string in printf to "%02d:%02dn" to have a leading 0






share|improve this answer














there is a single little difficulty : splitting arround ":", there is an awk function : split(what,where,sep).



I tried in a solaris (it is a one line command)



echo 23:28 60 |
awk 'split($1,H,":") ; printf "%2d:%02dn",H[1]+(H[2]+$2)/60, (H[2]+$2)%60 '


where



  • split($1,H,":") will put 23 in H[1] and 28 in H[2]

use



echo 23:28 60 |
awk 'split($1,H,":") ; printf "%2d:%02dn",(H[1]+(H[2]+$2)/60)%24, (H[2]+$2)%60 '


to stay in 0-23 range for hour. change format string in printf to "%02d:%02dn" to have a leading 0







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 11 '17 at 8:23

























answered Nov 10 '17 at 15:34









Archemar

19k93366




19k93366











  • Interesting. I'll check this out when I reach home. I've decided to install Solaris on a VM and try anyway as this was nagging me for a long time today. Thanks!
    – mathB
    Nov 10 '17 at 15:36










  • This gives me 24:28. I need it to be 00:28. The 60 in the question is not constant, it varies - sometimes it'd be 120 or even 600. In that case, I don't want the result to show over 24 hours.
    – mathB
    Nov 10 '17 at 17:36










  • That just about does it! Thank you! echo 23:28 60 | awk 'split($1,H,":") ; printf "%2d:%02dn",(H[1]+(H[2]+$2)/60)%24, (H[2]+$2)%60 '
    – mathB
    Nov 11 '17 at 2:12
















  • Interesting. I'll check this out when I reach home. I've decided to install Solaris on a VM and try anyway as this was nagging me for a long time today. Thanks!
    – mathB
    Nov 10 '17 at 15:36










  • This gives me 24:28. I need it to be 00:28. The 60 in the question is not constant, it varies - sometimes it'd be 120 or even 600. In that case, I don't want the result to show over 24 hours.
    – mathB
    Nov 10 '17 at 17:36










  • That just about does it! Thank you! echo 23:28 60 | awk 'split($1,H,":") ; printf "%2d:%02dn",(H[1]+(H[2]+$2)/60)%24, (H[2]+$2)%60 '
    – mathB
    Nov 11 '17 at 2:12















Interesting. I'll check this out when I reach home. I've decided to install Solaris on a VM and try anyway as this was nagging me for a long time today. Thanks!
– mathB
Nov 10 '17 at 15:36




Interesting. I'll check this out when I reach home. I've decided to install Solaris on a VM and try anyway as this was nagging me for a long time today. Thanks!
– mathB
Nov 10 '17 at 15:36












This gives me 24:28. I need it to be 00:28. The 60 in the question is not constant, it varies - sometimes it'd be 120 or even 600. In that case, I don't want the result to show over 24 hours.
– mathB
Nov 10 '17 at 17:36




This gives me 24:28. I need it to be 00:28. The 60 in the question is not constant, it varies - sometimes it'd be 120 or even 600. In that case, I don't want the result to show over 24 hours.
– mathB
Nov 10 '17 at 17:36












That just about does it! Thank you! echo 23:28 60 | awk 'split($1,H,":") ; printf "%2d:%02dn",(H[1]+(H[2]+$2)/60)%24, (H[2]+$2)%60 '
– mathB
Nov 11 '17 at 2:12




That just about does it! Thank you! echo 23:28 60 | awk 'split($1,H,":") ; printf "%2d:%02dn",(H[1]+(H[2]+$2)/60)%24, (H[2]+$2)%60 '
– mathB
Nov 11 '17 at 2:12












up vote
0
down vote













With awk, you could do the following:



awk -v dayt="2017 11 10 23 28 23" 'tmstmp=mktime(dayt)+60;print strftime("%M:%S",tmstmp)' <<< ""


Pass the FULL date and time to awk with the -v flag and then use the awk mktime to get a number representation of the date/time, adding 60 and then strftime to convert the representation to the required format.






share|improve this answer




















  • I'll check this on Monday as I've lost access to my system. Thanks for the answer and have a good weekend!
    – mathB
    Nov 10 '17 at 15:23










  • I guess I need %H%M in the answer, and this works in Linux, but not in Solaris. I get syntax error: < unexpected
    – mathB
    Nov 11 '17 at 2:13






  • 1




    1) I am not sure solaris's awk will accept mktime/strftime function, maybe gawk will. 2) you can use a second variable instead fo 60. 3) you can also use echo | ...
    – Archemar
    Nov 11 '17 at 13:29














up vote
0
down vote













With awk, you could do the following:



awk -v dayt="2017 11 10 23 28 23" 'tmstmp=mktime(dayt)+60;print strftime("%M:%S",tmstmp)' <<< ""


Pass the FULL date and time to awk with the -v flag and then use the awk mktime to get a number representation of the date/time, adding 60 and then strftime to convert the representation to the required format.






share|improve this answer




















  • I'll check this on Monday as I've lost access to my system. Thanks for the answer and have a good weekend!
    – mathB
    Nov 10 '17 at 15:23










  • I guess I need %H%M in the answer, and this works in Linux, but not in Solaris. I get syntax error: < unexpected
    – mathB
    Nov 11 '17 at 2:13






  • 1




    1) I am not sure solaris's awk will accept mktime/strftime function, maybe gawk will. 2) you can use a second variable instead fo 60. 3) you can also use echo | ...
    – Archemar
    Nov 11 '17 at 13:29












up vote
0
down vote










up vote
0
down vote









With awk, you could do the following:



awk -v dayt="2017 11 10 23 28 23" 'tmstmp=mktime(dayt)+60;print strftime("%M:%S",tmstmp)' <<< ""


Pass the FULL date and time to awk with the -v flag and then use the awk mktime to get a number representation of the date/time, adding 60 and then strftime to convert the representation to the required format.






share|improve this answer












With awk, you could do the following:



awk -v dayt="2017 11 10 23 28 23" 'tmstmp=mktime(dayt)+60;print strftime("%M:%S",tmstmp)' <<< ""


Pass the FULL date and time to awk with the -v flag and then use the awk mktime to get a number representation of the date/time, adding 60 and then strftime to convert the representation to the required format.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 10 '17 at 14:50









Raman Sailopal

1,18117




1,18117











  • I'll check this on Monday as I've lost access to my system. Thanks for the answer and have a good weekend!
    – mathB
    Nov 10 '17 at 15:23










  • I guess I need %H%M in the answer, and this works in Linux, but not in Solaris. I get syntax error: < unexpected
    – mathB
    Nov 11 '17 at 2:13






  • 1




    1) I am not sure solaris's awk will accept mktime/strftime function, maybe gawk will. 2) you can use a second variable instead fo 60. 3) you can also use echo | ...
    – Archemar
    Nov 11 '17 at 13:29
















  • I'll check this on Monday as I've lost access to my system. Thanks for the answer and have a good weekend!
    – mathB
    Nov 10 '17 at 15:23










  • I guess I need %H%M in the answer, and this works in Linux, but not in Solaris. I get syntax error: < unexpected
    – mathB
    Nov 11 '17 at 2:13






  • 1




    1) I am not sure solaris's awk will accept mktime/strftime function, maybe gawk will. 2) you can use a second variable instead fo 60. 3) you can also use echo | ...
    – Archemar
    Nov 11 '17 at 13:29















I'll check this on Monday as I've lost access to my system. Thanks for the answer and have a good weekend!
– mathB
Nov 10 '17 at 15:23




I'll check this on Monday as I've lost access to my system. Thanks for the answer and have a good weekend!
– mathB
Nov 10 '17 at 15:23












I guess I need %H%M in the answer, and this works in Linux, but not in Solaris. I get syntax error: < unexpected
– mathB
Nov 11 '17 at 2:13




I guess I need %H%M in the answer, and this works in Linux, but not in Solaris. I get syntax error: < unexpected
– mathB
Nov 11 '17 at 2:13




1




1




1) I am not sure solaris's awk will accept mktime/strftime function, maybe gawk will. 2) you can use a second variable instead fo 60. 3) you can also use echo | ...
– Archemar
Nov 11 '17 at 13:29




1) I am not sure solaris's awk will accept mktime/strftime function, maybe gawk will. 2) you can use a second variable instead fo 60. 3) you can also use echo | ...
– Archemar
Nov 11 '17 at 13:29










up vote
0
down vote













This is a bit of a experimental hack but works with modern versions of bash. I tested it on CentOS 7 and Fedora 26



#!/bin/bash

hr="23"
mi="28"
duration="60"

printf '%(%H%M)Tn' "$((-(19 * 60 * 60) + (hr * 60 * 60) + (mi * 60) + (duration * 60) ))"


Result is 0028.






share|improve this answer




















  • Hmmm. This works on a Ubuntu bash (I get 1058 instead of 0028 but I guess that's timezone thing?), but not on Solaris bash :D No idea why, but I'm getting this error - bash: printf: '(': invalid format character. I've double checked, did not mess up the braces.
    – mathB
    Nov 11 '17 at 13:37










  • What version of bash on Solaris? Looks like an old version where %T not supported. What version of Solaris?
    – fpmurphy1
    Nov 11 '17 at 15:54











  • Version 10 of Solaris and version 3.2.51(1) of bash
    – mathB
    Nov 11 '17 at 15:59














up vote
0
down vote













This is a bit of a experimental hack but works with modern versions of bash. I tested it on CentOS 7 and Fedora 26



#!/bin/bash

hr="23"
mi="28"
duration="60"

printf '%(%H%M)Tn' "$((-(19 * 60 * 60) + (hr * 60 * 60) + (mi * 60) + (duration * 60) ))"


Result is 0028.






share|improve this answer




















  • Hmmm. This works on a Ubuntu bash (I get 1058 instead of 0028 but I guess that's timezone thing?), but not on Solaris bash :D No idea why, but I'm getting this error - bash: printf: '(': invalid format character. I've double checked, did not mess up the braces.
    – mathB
    Nov 11 '17 at 13:37










  • What version of bash on Solaris? Looks like an old version where %T not supported. What version of Solaris?
    – fpmurphy1
    Nov 11 '17 at 15:54











  • Version 10 of Solaris and version 3.2.51(1) of bash
    – mathB
    Nov 11 '17 at 15:59












up vote
0
down vote










up vote
0
down vote









This is a bit of a experimental hack but works with modern versions of bash. I tested it on CentOS 7 and Fedora 26



#!/bin/bash

hr="23"
mi="28"
duration="60"

printf '%(%H%M)Tn' "$((-(19 * 60 * 60) + (hr * 60 * 60) + (mi * 60) + (duration * 60) ))"


Result is 0028.






share|improve this answer












This is a bit of a experimental hack but works with modern versions of bash. I tested it on CentOS 7 and Fedora 26



#!/bin/bash

hr="23"
mi="28"
duration="60"

printf '%(%H%M)Tn' "$((-(19 * 60 * 60) + (hr * 60 * 60) + (mi * 60) + (duration * 60) ))"


Result is 0028.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 11 '17 at 9:52









fpmurphy1

2,231915




2,231915











  • Hmmm. This works on a Ubuntu bash (I get 1058 instead of 0028 but I guess that's timezone thing?), but not on Solaris bash :D No idea why, but I'm getting this error - bash: printf: '(': invalid format character. I've double checked, did not mess up the braces.
    – mathB
    Nov 11 '17 at 13:37










  • What version of bash on Solaris? Looks like an old version where %T not supported. What version of Solaris?
    – fpmurphy1
    Nov 11 '17 at 15:54











  • Version 10 of Solaris and version 3.2.51(1) of bash
    – mathB
    Nov 11 '17 at 15:59
















  • Hmmm. This works on a Ubuntu bash (I get 1058 instead of 0028 but I guess that's timezone thing?), but not on Solaris bash :D No idea why, but I'm getting this error - bash: printf: '(': invalid format character. I've double checked, did not mess up the braces.
    – mathB
    Nov 11 '17 at 13:37










  • What version of bash on Solaris? Looks like an old version where %T not supported. What version of Solaris?
    – fpmurphy1
    Nov 11 '17 at 15:54











  • Version 10 of Solaris and version 3.2.51(1) of bash
    – mathB
    Nov 11 '17 at 15:59















Hmmm. This works on a Ubuntu bash (I get 1058 instead of 0028 but I guess that's timezone thing?), but not on Solaris bash :D No idea why, but I'm getting this error - bash: printf: '(': invalid format character. I've double checked, did not mess up the braces.
– mathB
Nov 11 '17 at 13:37




Hmmm. This works on a Ubuntu bash (I get 1058 instead of 0028 but I guess that's timezone thing?), but not on Solaris bash :D No idea why, but I'm getting this error - bash: printf: '(': invalid format character. I've double checked, did not mess up the braces.
– mathB
Nov 11 '17 at 13:37












What version of bash on Solaris? Looks like an old version where %T not supported. What version of Solaris?
– fpmurphy1
Nov 11 '17 at 15:54





What version of bash on Solaris? Looks like an old version where %T not supported. What version of Solaris?
– fpmurphy1
Nov 11 '17 at 15:54













Version 10 of Solaris and version 3.2.51(1) of bash
– mathB
Nov 11 '17 at 15:59




Version 10 of Solaris and version 3.2.51(1) of bash
– mathB
Nov 11 '17 at 15:59

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403760%2fhours-and-minutes-addition-in-solaris%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay