• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Get epoch time value in SKILL

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 143
  • Views 15539
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Get epoch time value in SKILL

Quesar
Quesar over 5 years ago

As the subject says, I would like to get the epoch time value in SKILL. I know it can be done through ipcBeginProcess and ipcReadProcess, but that seems a little heavy for such a simple task.

The function "getCurrentTime" only seems to return a nice string, but again, I don't want to go through the trouble of converting that to its epoch value. The function itself doesn't have any option to provide that either.

Is there any simple, direct way to obtain this, or must I resort to one of the above methods?

Thanks.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    I assume you really don't mean the epoch time value - since that's 1st January 1970 00:00:00 UTC. You can (almost) get this using timeToString(1) - for some reason it doesn't work with 0 as the argument, so you get 1 second after the epoch (in the time zone you're in).

    Anyway, I'm guessing you really want the time in seconds  since  the epoch? If so, there are several relevant functions here:

    Function Description
    stringToTime(dateStr) Converts a date string (like the output from getCurrentTime()) into the number of seconds since the Epoch (i.e. UNIX time)
    timeToString(timeInt) Opposite of stringToTime - converts a time since epoch value into a formatted string
    timeToTm(timeInt) Produces a structure with breakdown of year, month, date, hour, minutes, seconds - easy to decompose
    tmToTime(tm) Opposite of timeToTm - takes tm structure and converts back into a UNIX time since epoch
    getCurrentTime() Returns a formatted string with the current time
    compareTime(timeStr1 timeStr2) Compares two formatted date/time strings and returns the difference in seconds

    For more details use cdsFinder and then press the "more info" button to find the full documentation for each function.

    So no need to use IPC to do this (provided that my assumptions about what you mean by epoch are correct).

    Andrew.

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Quesar
    Quesar over 5 years ago in reply to Andrew Beckett

    Thanks Andrew! Yes, you're right, what I really meant was "time since the epoch in seconds". I found what I wanted with (stringToTime (getCurrentTime)) as you helpfully pointed out above.

    Thanks again!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information