First put your texts into an array:
private static final String[] arabicTimeOfDay = { "منتصف الليل", "صباحًا", "ظهرًا", "مساءً" };
Then use your array like this:
LocalTime time = LocalTime.now(ZoneId.of("Europe/Kiev"));
int quarterOfDay = time.getHour() / 6;
System.out.println("" + time + ' ' + arabicTimeOfDay[quarterOfDay]);
Running just now (13:48 in Kyiv) it printed:
13:48:55.590 ظهرًا
Dividing the hour of day by 6 as I do is probably a bit rigid and coarse-grained. You may want to set up cut-over times instead and check against each to find the proper interval and then use the text for that interval. This would allow to change the evening to begin an hour earlier or later, for example. Use LocalTime.isBefore
and LocalTime.isAfter
for comparing times of day.