ホーム › System.RemoteDesktop › WTS_SYSTEMTIME
WTS_SYSTEMTIME
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| wYear | WORD | 2 | +0 | +0 | 1601 から 30827 までの年です。 |
| wMonth | WORD | 2 | +2 | +2 | 標準時から夏時間への切り替えが発生する月です。次のいずれかの値を指定できます。 11 月 22 月 33 月 44 月 55 月 66 月 77 月 88 月 99 月 1010 月 1111 月 1212 月 |
| wDayOfWeek | WORD | 2 | +4 | +4 | 切り替えが発生する曜日です。次のいずれかの値を指定できます。 0日曜日 1月曜日 2火曜日 3水曜日 4木曜日 5金曜日 6土曜日 |
| wDay | WORD | 2 | +6 | +6 | 切り替えが発生する日です。 |
| wHour | WORD | 2 | +8 | +8 | 切り替えが発生する時です。 |
| wMinute | WORD | 2 | +10 | +10 | 切り替えが発生する分です。 |
| wSecond | WORD | 2 | +12 | +12 | 切り替えが発生する秒です。 |
| wMilliseconds | WORD | 2 | +14 | +14 | 切り替えが発生するミリ秒です。 |
公式ドキュメント
標準時と夏時間の間の切り替えに関する日付と時刻の情報を指定します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// WTS_SYSTEMTIME (x64 16 / x86 16 バイト)
typedef struct WTS_SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} WTS_SYSTEMTIME;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WTS_SYSTEMTIME
{
public ushort wYear;
public ushort wMonth;
public ushort wDayOfWeek;
public ushort wDay;
public ushort wHour;
public ushort wMinute;
public ushort wSecond;
public ushort wMilliseconds;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WTS_SYSTEMTIME
Public wYear As UShort
Public wMonth As UShort
Public wDayOfWeek As UShort
Public wDay As UShort
Public wHour As UShort
Public wMinute As UShort
Public wSecond As UShort
Public wMilliseconds As UShort
End Structureimport ctypes
from ctypes import wintypes
class WTS_SYSTEMTIME(ctypes.Structure):
_fields_ = [
("wYear", ctypes.c_ushort),
("wMonth", ctypes.c_ushort),
("wDayOfWeek", ctypes.c_ushort),
("wDay", ctypes.c_ushort),
("wHour", ctypes.c_ushort),
("wMinute", ctypes.c_ushort),
("wSecond", ctypes.c_ushort),
("wMilliseconds", ctypes.c_ushort),
]#[repr(C)]
pub struct WTS_SYSTEMTIME {
pub wYear: u16,
pub wMonth: u16,
pub wDayOfWeek: u16,
pub wDay: u16,
pub wHour: u16,
pub wMinute: u16,
pub wSecond: u16,
pub wMilliseconds: u16,
}import "golang.org/x/sys/windows"
type WTS_SYSTEMTIME struct {
wYear uint16
wMonth uint16
wDayOfWeek uint16
wDay uint16
wHour uint16
wMinute uint16
wSecond uint16
wMilliseconds uint16
}type
WTS_SYSTEMTIME = record
wYear: Word;
wMonth: Word;
wDayOfWeek: Word;
wDay: Word;
wHour: Word;
wMinute: Word;
wSecond: Word;
wMilliseconds: Word;
end;const WTS_SYSTEMTIME = extern struct {
wYear: u16,
wMonth: u16,
wDayOfWeek: u16,
wDay: u16,
wHour: u16,
wMinute: u16,
wSecond: u16,
wMilliseconds: u16,
};type
WTS_SYSTEMTIME {.bycopy.} = object
wYear: uint16
wMonth: uint16
wDayOfWeek: uint16
wDay: uint16
wHour: uint16
wMinute: uint16
wSecond: uint16
wMilliseconds: uint16struct WTS_SYSTEMTIME
{
ushort wYear;
ushort wMonth;
ushort wDayOfWeek;
ushort wDay;
ushort wHour;
ushort wMinute;
ushort wSecond;
ushort wMilliseconds;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WTS_SYSTEMTIME サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; wYear : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; wMonth : WORD (+2, 2byte) wpoke st,2,値 / 値 = wpeek(st,2)
; wDayOfWeek : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; wDay : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; wHour : WORD (+8, 2byte) wpoke st,8,値 / 値 = wpeek(st,8)
; wMinute : WORD (+10, 2byte) wpoke st,10,値 / 値 = wpeek(st,10)
; wSecond : WORD (+12, 2byte) wpoke st,12,値 / 値 = wpeek(st,12)
; wMilliseconds : WORD (+14, 2byte) wpoke st,14,値 / 値 = wpeek(st,14)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WTS_SYSTEMTIME
#field short wYear
#field short wMonth
#field short wDayOfWeek
#field short wDay
#field short wHour
#field short wMinute
#field short wSecond
#field short wMilliseconds
#endstruct
stdim st, WTS_SYSTEMTIME ; NSTRUCT 変数を確保
st->wYear = 100
mes "wYear=" + st->wYear