San Francisco is located in the Pacific Time Zone (PT), which is UTC-8 during standard time and UTC-7 during daylight saving time (DST). Thailand, on the other hand, is located in the Indochina Time Zone (ICT), which is UTC+7 throughout the year.
So, if it's 5 PM in San Francisco during standard time (non-DST period), you would need to add 15 hours (the time difference between PT and ICT) to convert it to Thailand time. This would make it 8 AM the following day in Thailand.
If it's 5 PM in San Francisco during daylight saving time (DST), you would add 14 hours (the time difference between PDT and ICT) to convert it to Thailand time. This would make it 7 AM the following day in Thailand.
Therefore, when it's 5 PM in San Francisco, it's either 8 AM or 7 AM the following day in Thailand, depending on whether DST is in effect or not.