tl;dr
ZonedDateTime
.of(
LocalDate.parse( "2022-06-23" ) ,
LocalTime.parse( "15:30" ) ,
ZoneId.of( "Europe/Dublin" )
)
.toInstant()
.atOffset(
ZoneOffset.UTC
)
See this code run live at IdeOne.com. We see that in the summer next year, the people of Ireland will have their clocks set to one hour ahead of UTC: 15:30 in Dublin time will be 14:30 in UTC time.
2022-06-23T14:30Z
Details
Your title asks:
How to know current timezone of Ireland in a given time in java
Ireland has only one time zone, per my reading of this Wikipedia article: Europe/Dublin.
You are confusing offsets with zones.
An offset-from-UTC is simply a number of hours-minutes-seconds ahead of, or behind, the modern temporal meridian.
A time zone is much more. A time zone is a named history of the past, present, and future changes to the offset used by the people of a particular region as decided by their politicians.
A real time zone is named in Continent/Region format. The 2-4 character pseudo-zones such as IST are not time zones, and should be avoided as they are not standardized and are not even unique! To some, IST is Ireland Standard Time, while to others IST is India Standard Time.
You said:
I get datetime without any GMT information from a source, and it's from Ireland.
So take your date and time-of-day and add the time zone you presume was intended. You get a ZonedDateTime to represent a moment, a specific point on the timeline.
LocalDate ld = … ;
LocalTime lt = … ;
ZoneId z = ZoneId.of( "Europe/Dublin" ) ;
ZonedDateTime zdt = ZonedDateTime.of( ld , lt , z ) ;
Adjust to UTC (an offset of zero hours-minutes-seconds) by extracting a Instant.
Instant instant = zdt.toInstant() ;
For more flexibility such as generating text in various formats, convert to OffsetDateTime.
OffsetDateTime odt = instant.atOffset( ZoneOffset.UTC ) ;