These forums are a place for learning, helping and sharing experiences with others about any of our products. Feel free to ask a question and get answers from our community and our most advanced users.
Note that these are public forums - anyone can view the discussions here.
VISIT OUR DIFFERENT FORUMS:
Announcements > | |
CloudShell > | TestShell > |
Developers > | BI (Business Inteligence) > |
This is where you can suggest your ideas to help and improve the product for everyone.
Please make sure to read the following article before posting a new idea, to get more information about the required information and ideas lifecycle.
Feel free to vote and comment on other ideas to promote them.
Thanks for everyone who suggested the ideas and voted for them.
Find, download and share integrations that can extend and enhance the CloudShell experience.
Integrations have several levels:
Certified - Officially tested and supported by Quali.
Preview - Provides a sneak peek to what the Quali team is developing. Officially supported by Quali. Feel free to experiment and comment, but please take into consideration that it is not yet tested and released.
Community - Integrations shared by community users. Feel free to look into what other users have contributed, please take into consideration that these integrations are not tested by Quali.
To learn more about creating Shells and integrating with CloudShell, use the following links:
CloudShell's Dev Guide > | Configuration Management > |
Getting started with Shells > | Extending CloudShell with Cloud Providers > |
Getting started with Orchestration > | API Guide > |
To share your integration, follow the instructions in this guide >.
I need to pass epoch time to a library it would be good we have a function, otherwise, every time need to call command shell to get from windows powershell
Answer by Yaniv Kalsky · Jun 07, 2019 at 05:24 PM
You can try to use the following matshell script:
/*The time difference between the machine running the code to the UTC time zone. Can be positive or negative*/ hoursfromutc = 7 /*Calculate "now" in UTC*/ utc = addtotime(currenttime2str('yyyy/M/d/H/m/ss'),hoursfromutc,'hour','yyyy/M/d/H/m/ss') /*convert to a numeric vector to be used with time2str*/ utcvect = str2num(str2vect(utc, '/')) /*calculate the diff between now(as UTC) to epoch time (1/1/1970)*/ epoch = timediff(time2str(utcvect,'M/d/yyyy H:mm'),'1/1/1970 0:00','M/d/yyyy H:mm')
It will be almost accurate, but there's still the issue of providing the hours from UTC (7 in this example), which will change between time zones and daylight saving.
Same thing as one-line:
epoch = timediff(time2str(str2num(str2vect(addtotime(currenttime2str('yyyy/M/d/H/m/ss'),7,'hour','yyyy/M/d/H/m/ss'), '/')),'M/d/yyyy H:mm'),'1/1/1970 0:00','M/d/yyyy H:mm')
Yaniv
These forums are a place for learning, helping and sharing experiences with others about any of our products. Feel free to ask a question and get answers from our community and our most advanced users.
Note that these are public forums - anyone can view the discussions here.
Announcements | |
CloudShell | TestShell |
Developers | BI (Business Inteligence) |
This is where you can suggest your ideas to help and improve the product for everyone.
Please make sure to read the following article before posting a new idea, to get more information about the required information and ideas lifecycle.
Feel free to vote and comment on other ideas to promote them.
Thanks for everyone who suggested the ideas and voted for them.
Find, download and share integrations that can extend and enhance the CloudShell experience.
Integrations have several levels:
Certified - Officially tested and supported by Quali.
Preview - Provides a sneak peek to what the Quali team is developing. Officially supported by Quali. Feel free to experiment and comment, but please take into consideration that it is not yet tested and released.
Community - Integrations shared by community users. Feel free to look into what other users have contributed, please take into consideration that these integrations are not tested by Quali.
To learn more about creating Shells and integrating with CloudShell, use the following links:
CloudShell's Dev Guide | Configuration Management |
Getting started with Shells | Extending CloudShell with Cloud Providers |
Getting started with Orchestration | API Guide |
To share your integration, follow the instructions in this guide.
What is the best way to convert date strings like 06-Jun-2017 to 06/06/2017? 1 Answer
Select Subset of Matrix by Indices 2 Answers
How to specify line break delimiter in str2vec()? 3 Answers
How to merge a Vector variable into Scalar? 4 Answers
performing calculation on matrix cells using transformations 1 Answer