Jump to content

Recommended Posts

Posted

Hi everyone 👋

Very new to scripting in general so forgive me if this is a dumb question.

SciTE says the following is incorrect however it appears to be working:  $nowtime = _Date_Time_SystemTimeToDateTimeStr(_Date_Time_GetLocalTime(), 1,1)

Error _Date_Time_systemTimeToDateTimeStr() called with Const or expression on ByRef-param(s).

Can these types of issue be ignored or should I be writing this another way?

Thanks :)

Posted (edited)
8 hours ago, tom_tech0278 said:

Hi everyone 👋

Very new to scripting in general so forgive me if this is a dumb question.

SciTE says the following is incorrect however it appears to be working:  $nowtime = _Date_Time_SystemTimeToDateTimeStr(_Date_Time_GetLocalTime(), 1,1)

Error _Date_Time_systemTimeToDateTimeStr() called with Const or expression on ByRef-param(s).

Can these types of issue be ignored or should I be writing this another way?

Thanks :)

From help file:

Decode a system time to a date/time string

#include <Date.au3>
_Date_Time_SystemTimeToDateTimeStr ( ByRef $tSYSTEMTIME [, $iFmt = 0 [, $iType = 0]] )

Parameters

$tSYSTEMTIME

$tagSYSTEMTIME structure

$iFmt

[optional] 0 returns mm/dd/yyyy hh:mm:ss (Default)
1 returns yyyy/mm/dd hh:mm:ss
2 returns wday, nn MMM yyyy hh:mm:ss GMT
3 returns yyyy/mm/ddThh:mm:ssZ (ISO8601)

or yyyy/mm/ddThh:mm:ss-hh:mm

$iType

[optional] 0 $tSYSTEMTIME contain a System Time (Default)
1 $tSYSTEMTIME contain a Local Time

 

$iType will know $tSYSTEMTIME contain a Local Time ?

else

no need  is system time 0 = (Default)

Must user have local time = system time

Hear the $LTime is local or system time ?

 

#include <Date.au3>

$LTime = _Date_Time_GetLocalTime() ; local time
$StrDate = _Date_Time_SystemTimeToDateTimeStr($Ltime)
ConsoleWrite("--> " & $StrDate & @CRLF)

$LTime = _Date_Time_GetSystemTimes() ; System time
$StrDate = _Date_Time_SystemTimeToDateTimeStr($Ltime)
ConsoleWrite("--> " & $StrDate & @CRLF & @CRLF)

$LTime = _Date_Time_GetLocalTime() ; local time
$StrDate = _Date_Time_SystemTimeToDateTimeStr($Ltime, 1)

ConsoleWrite("--> " & $StrDate & @CRLF)

 

The ByRef keyword indicates that the parameter should be treated as a reference to the original.

By default the parameter is copied into a new variable but ByRef links the new variable to the original

and hear:

$nowtime = _Date_Time_SystemTimeToDateTimeStr(_Date_Time_GetLocalTime(), 1,1)

the _Date_Time_GetLocalTime()  is empty ! :)

 

Edited by ioa747

I know that I know nothing

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...