File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,9 @@ public async Task<string> GetStationBoardAsync(
4848 CancellationToken cancellationToken = default )
4949 {
5050 // Format: yyMMddHHmm (e.g., 2511051830 for 2025-11-05 18:30)
51- var dateParam = date ? . ToString ( "yyMMdd" ) ?? DateTime . UtcNow . ToString ( "yyMMdd" ) ;
52- var hourParam = date ? . ToString ( "HH" ) ?? DateTime . UtcNow . ToString ( "HH" ) ;
51+ var germanTime = TimeZoneInfo . ConvertTimeFromUtc ( DateTime . UtcNow , TimeZoneInfo . FindSystemTimeZoneById ( "Central European Standard Time" ) ) ;
52+ var dateParam = date ? . ToString ( "yyMMdd" ) ?? germanTime . ToString ( "yyMMdd" ) ;
53+ var hourParam = date ? . ToString ( "HH" ) ?? germanTime . ToString ( "HH" ) ;
5354
5455 using var request = new HttpRequestMessage ( HttpMethod . Get , $ "plan/{ evaNo } /{ dateParam } /{ hourParam } ") ;
5556 request . Headers . Add ( "DB-Client-Id" , _config . ClientId ) ;
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public async Task<string> GetFullStationChanges(
4646 [ Description ( "Get station board (departures and arrivals) for a specific station in hourly slices. Returns XML data with train schedules." ) ]
4747 public async Task < string > GetStationBoard (
4848 [ Description ( "EVA station number (e.g., 8000105 for Frankfurt Hauptbahnhof)" ) ] string evaNo ,
49- [ Description ( "Date and time in format 'yyyy-MM-dd HH:mm' (UTC ). Leave empty for current time." ) ] string ? dateTime = null )
49+ [ Description ( "Date and time in format 'yyyy-MM-dd HH:mm' (German Time ). Leave empty for current time." ) ] string ? dateTime = null )
5050 {
5151 try
5252 {
@@ -119,7 +119,7 @@ public async Task<string> GetStationBoard(
119119 public async Task < string > FindTrainConnections (
120120 [ Description ( "Starting station name or EVA number (e.g., 'Frankfurt Hbf' or '8000105')" ) ] string stationA ,
121121 [ Description ( "Destination station name or EVA number (e.g., 'Berlin Hbf' or '8011160')" ) ] string stationB ,
122- [ Description ( "Date and time in format 'yyyy-MM-dd HH:mm' (UTC ). Leave empty for current time." ) ] string ? dateTime = null )
122+ [ Description ( "Date and time in format 'yyyy-MM-dd HH:mm' (German Time ). Leave empty for current time." ) ] string ? dateTime = null )
123123 {
124124 try
125125 {
You can’t perform that action at this time.
0 commit comments