Trouble getting LED ramp up based on clock time

I'm trying to get an LED to slowly brighten based on the time and then fade out later in the day at another specific time. The problem I'm having is that when I create the if statement the test LED fails to work. Removing the if statement and the LED reacts as it should gradually increasing in brightness and then dimming out.
The part I'm having issue with:

if (time_t() == "23:04:00") {
   while (PWM1_DutyCycle < 255)
     ledcWrite(PWM1_Ch, PWM1_DutyCycle++);
   delay(100);
 }
 if (time_t() == "23:15:00") {
   while (PWM1_DutyCycle > 0)
     ledcWrite(PWM1_Ch, PWM1_DutyCycle--);
   delay(100);
 }

The entire code

#include <Adafruit_LiquidCrystal.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include <WiFi.h>
#include <WiFiUdp.h>
#include <NTPClient.h>
#include <time.h>
#include <TimeLib.h>
#define LED_GPIO   5
#define PWM1_Ch    0
#define PWM1_Res   8
#define PWM1_Freq  1000

Adafruit_LiquidCrystal lcd(0x20);
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "pool.ntp.org", -14400, 3600);
Adafruit_BME280 bme;

int PWM1_DutyCycle = 0;
int RelayPin = 4;
int ledState = LOW;
unsigned long previousMillis = 0;
long OnTime = 900000;
long OffTime = 5400000;
float temperature, humidity;
const char* ssid = "xxxxxxxxxx";
const char* password = "xxxxxxxxxx";
char Time[ ] = "TIME:00:00:00";
byte last_second, second_, minute_, hour_;

void setup() {
  ledcAttachPin(LED_GPIO, PWM1_Ch);
  ledcSetup(PWM1_Ch, PWM1_Freq, PWM1_Res);
  lcd.begin(20, 4);
  Serial.begin(115200);
  Serial.printf("Connecting to %s ", ssid);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println(" CONNECTED");
  pinMode(2, OUTPUT);
  pinMode(RelayPin, OUTPUT);
  delay(1000);
  bme.begin(0x76);
  Serial.println("BME Initialized");
  timeClient.begin();
}

void loop() {
  lcd.setBacklight(HIGH);
  humidity = bme.readHumidity();
  temperature = bme.readTemperature();
  if (humidity >= 90) {
    digitalWrite(2, HIGH);
    Serial.println("Fan1 On");
    lcd.setCursor(0, 0);
    lcd.print ("Fan1 On");
  } else if (humidity <= 85) {
    digitalWrite(2, LOW);
    Serial.println("Fan1 Off");
    lcd.setCursor(0, 0);
    lcd.print ("Fan1 Off");
  }
  unsigned long currentMillis = millis();
  if ((ledState == HIGH) && (currentMillis - previousMillis >= OnTime)) {
    ledState = LOW;
    previousMillis = currentMillis;
    digitalWrite(RelayPin, ledState);
    Serial.println("Fan2 Off");
    lcd.setCursor(9, 0);
    lcd.print ("Fan2 Off");
  }
  else if ((ledState == LOW) && (currentMillis - previousMillis >= OffTime)) {
    ledState = HIGH;
    previousMillis = currentMillis;
    digitalWrite(RelayPin, ledState);
    Serial.println("Fan2 On");
    lcd.clear();
    lcd.setCursor(9, 0);
    lcd.print ("Fan2 On");
  }
  /* Serial.print("Humidity = ");
    Serial.print(humidity);
    Serial.println("%  ");*/
  lcd.setCursor(0, 1);
  lcd.print("RH=");
  lcd.print(humidity);
  lcd.print("%  ");

  /*Serial.print("Temp=");
    Serial.print(temperature);
    Serial.print("C  ");*/
  lcd.setCursor(10, 1);
  lcd.print("Tmp=");
  lcd.print(temperature);
  lcd.print("C  ");
  timeClient.update();
  unsigned long unix_epoch = timeClient.getEpochTime();
  second_ = second(unix_epoch);
  if (last_second != second_) {
    minute_ = minute(unix_epoch);
    hour_   = hour(unix_epoch);
    Time[12] = second_ % 10 + 48;
    Time[11] = second_ / 10 + 48;
    Time[9]  = minute_ % 10 + 48;
    Time[8]  = minute_ / 10 + 48;
    Time[6]  = hour_   % 10 + 48;
    Time[5]  = hour_   / 10 + 48;
    lcd.setCursor(0, 3);
    lcd.print(Time);
    last_second = second_;
  }
  if (time_t() == "23:04:00") {
    while (PWM1_DutyCycle < 255)
      ledcWrite(PWM1_Ch, PWM1_DutyCycle++);
    delay(100);
  }
  if (time_t() == "23:15:00") {
    while (PWM1_DutyCycle > 0)
      ledcWrite(PWM1_Ch, PWM1_DutyCycle--);
    delay(100);
  }
  delay(1000);
}

If time_t() returns a string (null terminated character array) you can't use == for comparison. Use the strcmp() function.

First - even leaving aside that strings cannot be compared in this way, as said in post#2,
this two lines in combination won't work

if (time_t() == "23:15:00") {
....
 delay(1000);

because one second delay makes it unlikely that your program will have time to catch the moment when the seconds are exactly "00"

And in general, using the time as a string and compare it with another string is extremely bad idea.
As I see in the code - you have a hour, minute and second as integers, what prevent you from using it for time comparison?

This will be over in a whiff

Thanks, question though, is comparing the string the best way or should I use time in a different way?

Okay, so I figured how to use time hour and min to get the LED to fade in and out but it doesn't completely fade out but I also remember something about the frequency and resolution and while dimming the LED it doesn't completely take it to 0 so that's why the LED is still faintly lit. I'm also goign to swap out the delay for mills its just taking a bit or research since I'm still very new to this.

 if (hour_ && minute_ == (20, 9))
    while (PWM1_DutyCycle < 255){
      ledcWrite(PWM1_Ch, PWM1_DutyCycle++);
   delay (100); 
  }
 else if (hour_ && minute_ == (20, 15))
    while (PWM1_DutyCycle > 0){
      ledcWrite(PWM1_Ch, PWM1_DutyCycle--);
    delay (100);

time_t is a data type, not a function.

#if !defined(__time_t_defined) // avoid conflict with newlib or other posix libc
typedef unsigned long time_t;
#endif

Thanks, question though, is comparing the string the best way or should I use time in a different way?

It looks like you are attempting to program by guessing. That never works. Look at the example sketches from the DataTime library to see how to handle time.

Using both the time and the DateTime library at the same time, is unusual. Why are you doing that? What processor/board do you have?

ESP32 is the board I'm using and the if statement works now, the LED ramps up when its supposed to and the same for when it is supposed to ramp down except for a faint glow because its not taken down to 0.

If the LED is wired correctly writing PWM of zero, or analogWrite(), or digitalWrite(0) should make it go dark.

So generally with time you use greater-than, or less-than, or combine them into a time window.

ESP32 you don't need the DateTime library, the Time library has everything you need.

Regards your problem, well your code is completely crackpot so no wonder. It's a caricature of C.

Crackpot lol Thanks your a big help! I figured it was only a matter of time before someone with absolutely nothing constructive to add to a conversation shows up just to add to their post count...

Absolutely nothing? I beg to differ. I guess you didn't read. It's not all broken but you clearly are guessing at a lot of C syntax and library usage.

Here is an example:

if (hour_ && minute_ == (20, 9))

Complete nonsense. There isn't anything better to describe it.

Again you're offering nothing constructive to the conversation besides your own self gratification by spewing out how garbage someone's code is. Perhaps stick with the topics where someone isn't trying to learn so you wont be so annoyed at how beneath you their coding abilities are.

Instead of getting your back up and barking, maybe ask what is wrong with the code and how to fix it. Some of the most knowledgeable members have contributed to this thread, I suggest that you take advantage. Alienate them and you are on your own.

I'm going to have to disagree. Just today a handful of WAGs went well. (With the obvious caveat that protecting property and life are generally a mutual exclusion.)

I'm going to have to disagree. @anon57585045, has offered good constructive criticism.

No one, including you, was born able to program.

The rhetoric is bordering on ad hominem. By more than one. There will be no more of that.

Please try to focus on getting and giving help.

So I've managed to get the time statement down so the LED turns on and off at the specified time and found out why the LED doesn't completely turn off so those issues are resolved but my next step is to replace the delays with mills. My question though is that the right approach especially if I want to draw out the fade in and out cycle to more closely simulate sunrise and sunset?

  if (hour_ == 12 && minute_ == 4)
 while (PWM1_DutyCycle < 255){
      ledcWrite(PWM1_Ch, PWM1_DutyCycle++);
  delay (100);    
  }
 if (hour_ >= 12 && minute_ >= 30)
 while (PWM1_DutyCycle > 0){
      ledcWrite(PWM1_Ch, PWM1_DutyCycle--);
   delay (100);