1
$\begingroup$

When you run Date, it outputs information about the date and time set on my computer.

Date[]

If I modify them, the output results will also be different.

How to express the current perspective of a particular country?

$\endgroup$
6
  • $\begingroup$ Are you asking about timezones and time offsets? $\endgroup$
    – lericr
    Commented Nov 21, 2023 at 23:06
  • $\begingroup$ For example, I would like to get the current date and time of Canada. And, even if I change the date and time on my computer, I want to get the actual date and time of the country where I live. $\endgroup$
    – Milk
    Commented Nov 21, 2023 at 23:09
  • $\begingroup$ Some countries have multiple time zones... $\endgroup$
    – MelaGo
    Commented Nov 21, 2023 at 23:42
  • $\begingroup$ Your code is not the result I want. If I change the time on my computer to 2020, the above result will also change to 2020. $\endgroup$
    – Milk
    Commented Nov 21, 2023 at 23:42
  • 3
    $\begingroup$ You can probably find an API that will give you the current data/time. Just call it from your Mathematica code with URLExecute (or other related functions). I haven't actually tried it, but maybe http://worldtimeapi.org $\endgroup$
    – lericr
    Commented Nov 21, 2023 at 23:57

2 Answers 2

1
$\begingroup$

Using the opinion you gave me above, I solved it as follows. Thank you all for the heat.

"datetime"/.Import[URL["http://worldtimeapi.org/api/timezone/Asia/Seoul"]]

enter image description here

$\endgroup$
1
$\begingroup$

TimeZoneConvert[DateObject[Date[]], "Asia/Seoul"]

$\endgroup$
1
  • 1
    $\begingroup$ Your answer already was posted and then deleted, because "The problem as I understood it is that Now isn’t necessarily “now” on OP’s machine". In other words, the OP wants a solution that does not rely on the time as determined by the computer's internal clock. $\endgroup$
    – bbgodfrey
    Commented Dec 31, 2023 at 2:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.