# -*- tcl -*- \
    last modified <20180123.1821.35>

proc DoWeHavePackage {package args} {
  if {[catch "package require $package" oops] == 0} {return 1}
  popInfo "The current command requires \"$args\" from package \"$package\"\
           \nwhich is not on this system. You must either install this\
           \npackage or use a system command that supplies \"$args\""
  return 0
}

proc GetTimeFromSecs { time } {
  global dateformat
  # Convert time in sec (UTC) to either yymmdd hh:mm:ss or ddmmyy hh:mm:ss
  return [clock format $time -format $dateformat]
}
proc GetTimeFromSecsSetFormat { format } {
  global dateformat
  # 0 -> yymmdd
  # 1 -> ddmmyy
  if { $format == 0 } {
    set dateformat "%y%m%d %H:%M:%S"
  } elseif { $format == 1 } {
    set dateformat "%d%m%y %H:%M:%S"
  } else {
    set dateformat $format
  }
}

 
proc ClockMilliSeconds { } {
  return [clock milliseconds]
}

proc GetEuid { } {
  global glob
  
  if { $glob(os) == "WIN32" } {
    return "1"
  }
  return "whodat"
}

