Skip to content

Commit

Permalink
Force the cam to work in local time
Browse files Browse the repository at this point in the history
  • Loading branch information
roleoroleo committed Jan 15, 2024
1 parent 651806b commit 8c8773f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/static/static/home/yi-hack/bin/cloudAPI_fake
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ elif [ "$c" = "142" ]; then
#CMD_do_get_dev_info
TIMEZONE=$(get_config TIMEZONE)
TZP=$(TZ="$TIMEZONE" date +%z)
TZP_SET=$(echo ${TZP:1:2} ${TZP:3:2} | awk '{ print ($1*3600+$2*60) }')
TZP_SET=$(echo ${TZP:0:1} ${TZP:1:2} ${TZP:3:2} | awk '{ print ($1$2*3600+$3*60) }')
TZP_GMT=$(echo GMT${TZP:0:1}${TZP:1:2}:${TZP:3:2})
#echo '{"code":"20000","data":{"timezone":"'$TZP_GMT'","language":"en-US","tz_offset":'$TZP_SET'000,"css_flag":0,"css_mode":0,"appParam":"","doorbellCoolingDuration":"0"}}'
echo '{"code":"20000","data":{"timezone":"'$TZP_GMT'","language":"en-US","tz_offset":'$TZP_SET'000,"css_flag":0,"css_mode":0,"appParam":"","doorbellCoolingDuration":"0","allowFeature":{"Vehicle":0,"Animal":0,"Person":1}}}'
Expand Down
7 changes: 2 additions & 5 deletions src/www/httpd/cgi-bin/eventsdir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ IDX=1
for f in `ls -r /tmp/sd/record | grep H`; do
if [ ${#f} == 14 ]; then
FS00="${f:0:4}-${f:5:2}-${f:8:2} ${f:11:2}:00"
# if [ "$HV" == "12" ]; then
# FS00E=$(date -d "$FS00" +"%s")
# else
FS00E=$(date -u -d "$FS00" +"%s")
# fi
# FS00E=$(date -u -d "$FS00" +"%s")
FS00E=$(date -d "$FS00" +"%s")
FL=$(date +%YY%mM%dD%HH -d "@$FS00E")
printf "{\n"
printf "\"%s\":\"%s\",\n" "datetime" "Date: ${FL:0:4}-${FL:5:2}-${FL:8:2} Time: ${FL:11:2}:00"
Expand Down
7 changes: 2 additions & 5 deletions src/www/httpd/cgi-bin/eventsfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ if [ "$DIR" == "none" ] ; then
fi

DIRS00="${DIR:0:4}-${DIR:5:2}-${DIR:8:2} ${DIR:11:2}:00"
#if [ "$HV" == "12" ]; then
# DIRS00E=$(date -d "$DIRS00" +"%s")
#else
DIRS00E=$(date -u -d "$DIRS00" +"%s")
#fi
#DIRS00E=$(date -u -d "$DIRS00" +"%s")
DIRS00E=$(date -d "$DIRS00" +"%s")
DIRL=$(date +%YY%mM%dD%HH -d "@$DIRS00E")

printf "Content-type: application/json\r\n\r\n"
Expand Down

0 comments on commit 8c8773f

Please sign in to comment.